3 ms·
> Bottom has to be a member of every type because functions aren't guaranteed to terminate, I don't understand: if the function you called doesn't terminate th
by renox 4y ago
> Bottom has to be a member of every type because functions aren't guaranteed to terminate,
I don't understand: if the function you called doesn't terminate then you're blocked so I don't see why this should impact the types..
- foldr 4y agoMore info here: https://wiki.haskell.org/Bottom https://wiki.haskell.org/Bottom As bottom is the value of a non-terminating computation and a computation of any type may fail to terminate, bottom must inhabit all types. The same goes for 'error'. Although in real world Haskell code (using GHC) you can trap error values if you really want to, so 'error' isn't in fact indistinguishable from non-termination.