News for hackers. Stuff that matters.
Re:Functional exceptionless error-handling with optional and... by kthielen on Sunday December 03, 2017 @03:23PM (#15839363)
I think that this dichotomy can be summarized with the old logical identity:

A or B = not(A) implies B

Considered as a statement about types, 'A or B' is a variant type over two constructors A/B (this is equivalent to an optional type, where A=unit).

Also as a statement about types, 'not(A) implies B' is a function taking a continuation on A (the exception handler) and returning a B (if it decides not to raise an exception).

So (as we often find in CS) this is a very old idea, older than computers and programming languages. :D

There are no comments on this comment yet.