Talking about the Haskell Prelude ...

IMHO as a Haskell user, one big problem with Haskell is the Prelude.
Its too specific in places, making it too big. Take for example the
lex function or the Complex numbers.  However in other places it lacks
in completeness. This is addressed with a (different) Pandora's box of
add-ons supplied with each of the Haskell implementations. The whole
area feels messy.

What about taking a leaf from the SML community ? They now have
(effectively) a two level prelude.

  1. The Base
  2. The Edinburgh ML Library

(I know it took them some time to get this far, but we can get it right :-)

Drawing from this pattern we *could* have
  1. A very small kernel, aka PreludeBuiltin, PreludeCore.

  2. A well defined *larger* set of other modules the user can import,
     like: Array, Text, IO, etc.

     With this we have a larger (and standard) second level base.

Example: Maybe !

Take the Maybe datatype. In all my programs I use it, so I need to
define it. But I want my program to run in standard haskell, so its
time to use #define :-( I could define it in the script like any
other data structure, but this defeats the point of our compiler
providing such things as add-ons to our compilers in the first place.

We would all hesitate with adding more and more to our prelude, but
adding a new (standard) module that we could all import would not
raise many eyebrows. A 2-level prelude would be one way of doing this.
It also provides an forum for people to add new libraries to Haskell
(like regular expressions, for example)

The difficult thing for the committee to decide is how to split up the
prelude ++ extras into a modular and extendible bundle. Coming from
the 'C' programming community, adding the line

> import IO

to my modules that actually do IO does not cause a problem :-)

Just some observations...

Andy Gill, Glasgow.

Reply via email to