Proposal: rename Data.Map.fromAscList to Data.Map.unsafeFromAscList

Krzysztof Skrzętnicki gtener at gmail.com
Fri Apr 24 09:48:13 EDT 2009


On Fri, Apr 24, 2009 at 15:26, Bulat Ziganshin <bulat.ziganshin at gmail.com>wrote:

> Hello Chris,
>
> Friday, April 24, 2009, 5:21:20 PM, you wrote:
>
> > No, but the functions you mentioned do fail immediately. If I use a
> > head on an empty list I get an error immediately. If I use fromAscList
> > incorrectly I get an error only when I try to lookup elements. This
> > makes it hard to debug if you didn't make this error before. I don't
> > mind a runtime error in this case, but I very much want to know where
> > my bug is.
>
> how about providing such check only in *debugging* version of library?
>

I think the decision whether to include specific check should be left up to
the developer. Perhaps I would like to retain only a subset of checks, while
debugging version restricts my freedom and I would end up writing my own
version. Giving functions with and without checks is a good way of giving
such freedom.

Regards

Christopher Skrzętnicki
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20090424/99229e28/attachment.htm


More information about the Libraries mailing list