[Haskell-cafe] Re: Interesting critique of Haskell

David Roundy droundy at darcs.net
Fri May 9 12:23:52 EDT 2008

On Fri, May 09, 2008 at 05:19:05PM +0100, Andrew Coppin wrote:
> Brent Yorgey wrote:
> >
> >On Fri, May 9, 2008 at 10:02 AM, Andrew Coppin 
> ><andrewcoppin at btinternet.com <mailto:andrewcoppin at btinternet.com>> wrote:
> >
> >    While I'm here - I'm aware of how you control importing [or not]
> >    from the Prelude. Is there a way that I can, for example, import
> >    all the stuff like the basic types, classes, etc., but *not* all
> >    the list-related stuff? Or is the Prelude not that modular?
> >
> >
> >Not only is the Prelude not that modular, there's not really any 
> >mechanism to make it so.  There's no way to partition an export list 
> >in such a way that whole chunks of it can be imported/not imported at 
> >a go.  Would that be a nice feature?  I don't know, possibly.
> Well, if the Prelude was split into several seperate modules, you could 
> import just the modules you wanted. That sounds pretty easy to me. [I 
> mean, apart from the minor detail that no current implementation works 
> this way...]
> By default, if you don't ask for anything, your module automatically 
> imports "Prelude". What if we made Prelude a module that just imports 
> and re-exports several other modules - Prelude.Types, Prelude.Classes, 
> Prelude.List (or rather, a subset of Data.List). Then if a module 
> imports Prelude, or anything under Prelude, it turns off the automatic 
> import, similar to the current system.
> Of course, I guess all this isn't likely to happen any time soon... I'm 
> just throwing ideas out there.

It's pretty easy (albeit tedious) to do this for yourself (except that you
wouldn't automatically turn off the import of Prelude, and you'd still
suffer from the instances disease).

module Prelude.Types ( Int, Double, Char, String ) where

import Prelude

More information about the Haskell-Cafe mailing list