Proposal to deprecate and then drop fromJust

Greg Weber greg at gregweber.info
Tue Feb 24 15:40:51 UTC 2015


Michael and I came up with an approach of using a convention in
mono-traversable where any partial function has the postfix `Ex`, which
stands for (throws a pure) Exception. So there is a `headEx` and `tailEx`
function. This is a very light-weight solution although it is certainly
easy for someone to ignore a new naming convention.

The automated warning stuff seems promising!

On Tue, Feb 24, 2015 at 7:14 AM, Gregory Collins <greg at gregorycollins.net>
wrote:

>
> On Mon, Feb 23, 2015 at 10:19 PM, Chris Allen <cma at bitemyapp.com> wrote:
>
>> Just a quick look on Github, filtering for uses of fromJust rather than
>> re-declarations (mostly), shows 9,418 uses.
>> ...
>> Searching for imports of Data.Maybe alone come to 19,985, indicating that
>> at least ~half of the time people import Data.Maybe, they're using fromJust.
>>
>
> Are you guys crazy?! I don't like partial functions either, but forget the
> -1, I vote to nuke this thread from orbit.
>
> I'm +1 to adding warning pragmas to the prelude's partial functions,
> however.
>
> G
> --
> Gregory Collins <greg at gregorycollins.net>
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150224/b79ab550/attachment.html>


More information about the Libraries mailing list