Implicit Prelude (was Re: Export lists in modules)

Ben Rudiak-Gould Benjamin.Rudiak-Gould at cl.cam.ac.uk
Thu Feb 23 14:52:24 EST 2006


Malcolm Wallace wrote:
> Yes, many trivial programs would acquire one extra import
> decl - is that such a big deal?

No, but overall it feels like a slight loss, because I'd expect the modules 
that gained a line to be shorter on average, and adding a line to a shorter 
module seems like a bigger deal than deleting a line from a longer module.

The impact would be especially noticeable on one-liners like

    main = putStr (s++show s) where s="main = putStr (s++show s) where s="

In fact, this suggests a compromise: how about implicitly importing the 
Prelude only if the module header is omitted? That way there'll be no impact 
on short (single-module) programs.

-- Ben



More information about the Haskell-prime mailing list