Drastic Prelude changes imminent

Edward Kmett ekmett at gmail.com
Tue Jan 27 22:17:36 UTC 2015


On Tue, Jan 27, 2015 at 3:18 PM, Eric Mertens <emertens at gmail.com> wrote:

> I can certainly see the reasoning in wanting Data.List.foldr to actually
> be the list-specific one, and this would be consistent with other cases
> like Data.Map. Changing this might break some code, but it might be a more
> reasonable situation in the end. If we're going to consider this it would
> probably be better in its own thread so that it doesn't get drowned out by
> the rest of the BBP discussion.
>

The main reason this wasn't done is that we ran quick trial balloon to see
which style broke less code.

Looking through hackage for usage of Data.List, quite a bit of it is done
unqualified.

Monomorphizing Data.List combinators would break code that is written as

import Data.List
foo = ... foldr ...

Removing them would break code that is written as

import qualified Data.List as List
foo = ... List.foldr ...

Both of these styles were fairly common, though the former more so.

In an ideal world we'd have never put them in Data.List in the first place,
same with mapM etc. in Control.Monad, etc. and then something like
Lennart's proposal here would have been viable.

The main thing we can learn from this is that having modules that
"conveniently" re-export stuff is a dangerous thing in terms of long term
API design.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20150127/a895b6e1/attachment-0001.html>


More information about the Libraries mailing list