[Haskell-cafe] testing for exceptions
joachifm at fastmail.fm
joachifm at fastmail.fm
Sat Oct 31 16:18:18 UTC 2015
The ability to express non-termination is a feature, not a bug. If the
program truly cannot produce a useful result for some input, it should
crash, the earlier the better. Wrapping the return value ONLY to make a
non-total program *appear* total is kind of ugly (and commits you to a
potentially inappropriate/nonsensical model for the problem at hand). It
is cleaner to either constrain the input to values you're prepared to
deal with or crash when the implicit invariant is violated.
More information about the Haskell-Cafe
mailing list