[Haskell-cafe] testing for exceptions

Darren Grant dedgrant at gmail.com
Sun Nov 1 05:50:50 UTC 2015


Great points.

I often run into situations where sketching out non-terminating endpoints
leads to a precise domain, but after peer review it becomes clear that a
much simpler program would result from compromising with a less precise
domain that eliminates these points altogether.

Eliminating branching on constructors in Haskell is a common aspect of this
refinement, it's true.

Cheers,
Darren
On Nov 1, 2015 03:18, <joachifm at fastmail.fm> wrote:

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.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20151101/4829df67/attachment.html>


More information about the Haskell-Cafe mailing list