Proposal to deprecate and then drop fromJust
Oleg Grenrus
oleg.grenrus at iki.fi
Tue Feb 24 13:09:45 UTC 2015
And I did it myself, as it was about adding one single line rule:
https://github.com/ndmitchell/hlint/pull/115 <https://github.com/ndmitchell/hlint/pull/115>
Let’s see what Neil thinks about :)
- Oleg
> On 24 Feb 2015, at 12:28, Oleg Grenrus <oleg.grenrus at iki.fi> wrote:
>
>
>> On 24 Feb 2015, at 12:23, Erik de Castro Lopo <mle+hs at mega-nerd.com <mailto:mle+hs at mega-nerd.com>> wrote:
>>
>> Possibly what we need is a pragma to mark functions partial and a warning
>> flag that warns on usage of functions that have been marked partial.
>>
>
> I had this in mind too, but that is very heavy solution. I’d rather start with making hlint warnings?
>
> foo :: Maybe Int -> Int
> foo x = if isJust x then fromJust x else 0
>
> bar :: Maybe Int -> Int
> bar x = 1 + fromJust x
>
> It warns about `foo` nonsense. It could propose to change `bar` part into `fromMaybe (error “I’know what I’m doing”) x` ?
>
> - Oleg
>
> _______________________________________________
> 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/76f5bdd4/attachment.html>
-------------- 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/76f5bdd4/attachment.sig>
More information about the Libraries
mailing list