Apologies

wren ng thornton wren at freegeek.org
Fri May 24 01:04:25 CEST 2013


On 5/21/13 2:06 AM, Gabriel Gonzalez wrote:
> APIs are like monad tutorials: it's better to teach people starting from
> something simple and concrete than something abstract.  If the Prelude
> is not for teaching purposes, then what is?

But the Prelude _isn't_ for teaching purposes. The Prelude is required
because the definition of Haskell is circular. For example, in order to
desugar do-notation, arithmetic sequences, etc (this syntax being part of
the "language"), it is necessary to have particular type-classes/functions
in scope (these functions being part of the "libraries"). The whole reason
for the Prelude is as a means of resolving this circularity.

It is just a happy side-effect that the Prelude offers some other
functions which may be useful for teaching or for reducing imports. I'm
all for helping learners, and I recognize that excessive
polymorphism/abstraction can flummox them, but the Prelude is not the
place for teaching (nor for importing the kitchen sink). Given the reason
for the Prelude's existence, it should IMO be kept as minimal as possible.

-- 
Live well,
~wren




More information about the Libraries mailing list