Proposal to deprecate and then drop fromJust

Oleg Grenrus oleg.grenrus at iki.fi
Tue Feb 24 07:59:35 UTC 2015


Hi,

Maybe move fromJust and other partial functions (head, !!, ..) into `partial` compatibility package?
When you need ones, you can get them, but it will be explicit.

- Oleg

> On 24 Feb 2015, at 07:42, Erik de Castro Lopo <mle+hs at mega-nerd.com> wrote:
> 
> Hi all,
> 
> We currently have in the Data.Maybe module from base:
> 
>     fromJust :: Maybe a -> a
> 
> which newbies often find using hoogle or other search tools and is
> a huge trap. *Every* usage of the above can be replaced by using
> 
>      fromMaybe :: a -> Maybe a -> a
> 
> which forces the user to provide a default value for the case where
> the Maybe a is a Nothing.
> 
> The idea would be to deprecate fromMaybe for 7.12 and remove it
> completely later.
> 
> Comments?
> 
> Erik
> --
> ----------------------------------------------------------------------
> Erik de Castro Lopo
> http://www.mega-nerd.com/
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20150224/2bb4970f/attachment.sig>


More information about the Libraries mailing list