[Haskell-cafe] Re: Why the Prelude must die
nicolas.frisby at gmail.com
Tue Mar 27 14:17:55 EDT 2007
Gut feeling: the quick'n dirty script case occurs far less than the
whole module case. Thus I think the benefit of automatically importing
the Prelude if the module declaration is omitted should not happen:
the Principle of Least Surprise out-weighs the small benefit to a rare
Correct me if I'm wrong about my hunch that the quick'n dirty case is
rare. Even so, I have a healthy respect both for Least Surprise and a
minimal number of behaviors when it comes to compilers.
My vote would be to never automatically import the Prelude, at least
not by default.
Regarding type variable naming, a few of my more hardware minded
friends I've asked to try Haskell often tease me about the opaque type
variable names in the Prelude--it seems greater consideration of type
variable names in the Prelude might behoove new users.
On 3/27/07, Lennart Augustsson <lennart at augustsson.net> wrote:
> I agree, I think this is what we need.
> Plus a decision of what names the builtin syntax refers to,
> like the type of 'a'.
> -- Lennart
> On Mar 26, 2007, at 23:30 , Ashley Yakeley wrote:
> > Sebastian Sylvan wrote:
> >> The solution is simple:
> >> * If there is a "module M where" clause in the beginning of the file,
> >> then it's a "proper" module and shouldn't import the Prelude.
> >> * If there is no module declaration then it's a "quick'n dirty
> >> script"
> >> and should have the Prelude implicitly imported.
> >> * Interactive interpreters should probably import the Prelude.
> >> That should take of most issues.
> > I think this is ideal. I've always thought writing "import Prelude"
> > was a good idea if one wants one's module to import the Prelude.
> > It's one less corner case.
> > --
> > Ashley Yakeley
> > _______________________________________________
> > Libraries mailing list
> > Libraries at haskell.org
> > http://www.haskell.org/mailman/listinfo/libraries
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe