4 ms·
Haskell doesn't have null, so Optional is the usual alternative (actually called "Maybe" in Haskell, but it's the same thing) Haskell values can throw exceptio
by chriswarbo 5y ago
Haskell doesn't have null, so Optional is the usual alternative (actually called "Maybe" in Haskell, but it's the same thing)
Haskell values can throw exceptions (e.g. for division-by-zero, etc.); but catching them (and therefore branching on them) is an IO effect.
That sort of exception is treated like an unfortunate necessity in Haskell; and user code tends to use a more structured, well-typed approach like Either (there are a few alternatives floating around in common libraries)