3 ms·
> not counting 'undefined', Haskell's dirty little not-secret There is no "undefined" value in pure Haskell. There are expressions that have no value, due to a
by nybble41 7y ago
> not counting 'undefined', Haskell's dirty little not-secret
There is no "undefined" value in pure Haskell. There are expressions that have no value, due to a runtime exception (error, undefined, division by zero, memory allocation failure) or non-termination (unbounded recursion). Either way, evaluating the expression does not produce a value for the remainder of the program to operate on—you can't write a (pure) program like `if isUndefined expr then x else y` since—assuming isUndefined is a pure function and doesn't ignore its argument—the whole program is undefined if expr is undefined.