[Haskell-cafe] Re: Interesting critique of Haskell

Andrew Coppin andrewcoppin at btinternet.com
Fri May 9 12:19:05 EDT 2008

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.

More information about the Haskell-Cafe mailing list