Hacker News new | ask | show | jobs
by renox 1338 days 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..

1 comments

More info here: 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.