Michael and I came up with an approach of using a convention in mono-traversable where any partial function has the postfix `Ex`, which stands for (throws a pure) Exception. So there is a `headEx` and `tailEx` function. This is a very light-weight solution although it is certainly easy for someone to ignore a new naming convention. The automated warning stuff seems promising! On Tue, Feb 24, 2015 at 7:14 AM, Gregory Collins <greg@gregorycollins.net> wrote:
On Mon, Feb 23, 2015 at 10:19 PM, Chris Allen <cma@bitemyapp.com> wrote:
Just a quick look on Github, filtering for uses of fromJust rather than re-declarations (mostly), shows 9,418 uses. ... 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.
Are you guys crazy?! I don't like partial functions either, but forget the -1, I vote to nuke this thread from orbit.
I'm +1 to adding warning pragmas to the prelude's partial functions, however.
G -- Gregory Collins <greg@gregorycollins.net>
_______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries