Drastic Prelude changes imminent

Yuras Shumovich shumovichy at gmail.com
Wed Jan 28 09:53:22 UTC 2015


On Tue, 2015-01-27 at 17:17 -0500, Edward Kmett wrote:
> 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.

That is probably the first thing I completely agree it this thread.
Reexporting is a pure evil.

The biggest "reexporter" is Prelude. It should be deprecated all
together. Polluting namespace and massive reexporting don't worth few
keystrokes to import Data.List or Data.Foldable (both qualified). That
way the FTP becomes unnecessary.

(IMO generalizing Data.List doesn't sound like a good idea)

Thanks,
Yuras

> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries




More information about the Libraries mailing list