Why the Prelude must die
David House
dmhouse at gmail.com
Sun Mar 25 12:22:24 EDT 2007
On 25/03/07, Ian Lynagh <igloo at earth.li> wrote:
> You wouldn't have to import a number of different modules like
> Data.Function, you could just import Prelude.
I guess what I was getting at was that Haskell is very good at
blurring the distinction between userland function and actual syntax.
E.g. to the untrained eye 'otherwise' may seem like a keyword, but
it's defined in Data.Bool. Functions like map and catamorphisms like
maybe and foldr are used just like control structures, not to mention
things like when and unless which are built to directly emulate
control structures in other languages.
As real control structures, like if and case, are always in scope,
having _no_ functions imported by default would drive an unnatural
wedge between function and control structure.
--
-David House, dmhouse at gmail.com
More information about the Libraries
mailing list