[Haskell-cafe] Re: Debugging partial functions by the rules

Neil Mitchell ndmitchell at gmail.com
Wed Nov 15 05:07:10 EST 2006


> Yes, these techniques are fairly well known now, and hopefully some of
> the more experienced Haskellers are using them (I certainly use the
> non-empty list tricks). Any anyone with more than 6 months Haskell knows
> to avoid fromJust.

I'm not, I use fromJust all the time. Ditto for head, init, maximum, foldr1...

> One solution would be to deprecate fromJust (we recently decided not to
> add fromLeft/Right for the same reasons). Having a compiler warning is a
> good way to encourage good behaviour :)

We didn't decide not to add fromLeft/fromRight, Russell decided to
defer it to a later patch. I am still very interested in them being
put in!

There seem to be two sides forming to this issue - use partial
functions or don't. I don't see why we should restrict the functions
available to the partial people, when the unpartial people can choose
not to use them.



More information about the Haskell-Cafe mailing list