-1 for this reason. A strong recommendation in the docs is enough. There are legitimate uses and the busy work involved in fixing the 10,000 uses is not with it. That's time that could be spent on more libraries.
Just a quick look on Github, filtering for uses of fromJust rather than re-declarations (mostly), shows 9,418 uses.
https://github.com/search?utf8=%E2%9C%93&q=extension%3Ahs+fromJust+%22import+Data.Maybe%22&type=Code&ref=searchresults
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.
https://github.com/search?utf8=%E2%9C%93&q=extension%3Ahs+%22import+Data.Maybe%22&type=Code&ref=searchresults
As a baseline, Data.List shows up 28k times.
https://github.com/search?utf8=%E2%9C%93&q=extension%3Ahs+%22import+Data.List%22&type=Code&ref=searchresults
This is just from a 3 minute glance. If we really want to narrow it down to Hackage I'll do something more thorough.
On 02/24/2015 12:13 AM, Bardur Arantsson wrote:
On 24-02-2015 06:42, Erik de Castro Lopo wrote:
Hi all,How much code on Hackage is currently using fromJust? (A rough estimate
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?
by group would probably be sufficient.)
Regards,
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries