On 24 Feb 2015, at 12:28, Oleg Grenrus <oleg.grenrus@iki.fi> wrote:_______________________________________________On 24 Feb 2015, at 12:23, Erik de Castro Lopo <mle+hs@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 -> Intfoo x = if isJust x then fromJust x else 0bar :: Maybe Int -> Intbar x = 1 + fromJust xIt 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@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries