[Haskell-cafe] Re: Is "take" behaving correctly?

Neil Mitchell ndmitchell at gmail.com
Thu Sep 13 08:56:43 EDT 2007


Hi

> >From the logical point of view tailMay is the right one.
> It pushes the error handling to the caller programm.
>
> tail = fromJust . tailMay

The error messages suffer:

tail [] = "error: fromJust Nothing"

That's why I supplied tailNote, where tailNote "foo broke its
invariant!" [] gives the message "error: tail [], foo broke its
invariant!"

Thanks

Neil


More information about the Haskell-Cafe mailing list