Proposal to deprecate and then drop fromJust

Erik de Castro Lopo mle+hs at mega-nerd.com
Tue Feb 24 09:28:28 UTC 2015


Roman Cheplyaka wrote:

> Say I have
> 
>   parse :: String -> Maybe Value
>   process :: Value -> IO ()
> 
> Then (process . fromJust . parse) is the fastest way to compose the two.

Wouldn't

     process fromMaybe defaultValue . parse

do as well?

> So I'm -1 on dropping fromJust, but I don't object to adding a
> deprecation warning to it.

<snip>

> Then again, why aren't we doing the same to head&tail?

I'd be very much in favour of that and would also add init and
last. However, these are pretty easy to avoid with a custom prelude
and the NoImplicitPrelude pragma.

Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/


More information about the Libraries mailing list