anoma / geb

A Categorical View of Computation
https://anoma.github.io/geb/
GNU General Public License v3.0
28 stars 10 forks source link

Error node needs extension from `Maybe` to `Either E` #133

Open rokopt opened 1 year ago

rokopt commented 1 year ago

The new error node (see #90 and #129) currently introduces Maybes for places where it passes errors back to clients (see also #132, which proposes an extension to allow clients to choose to crash right away rather than catch and return errors). It will need to be extended to Either E, where E is a client-chosen type. This subsumes not only Maybe (where E is Unit) but also circuits where there are no failures (where E is Void), thus undoing the regression that we can no longer represent circuits that can be statically guaranteed not to fail, as well as allowing clients to distinguish among different, configurable classes of errors.