IO monad and lazy evaluation

Alastair Reid alastair@reid-consulting-uk.ltd.uk
Thu, 22 May 2003 12:10:20 +0100


On Thursday 22 May 2003 10:22 am, Graham Klyne wrote:
> I'm not yet fully used to the distribution of functions
> between standard libraries and the Prelude.

The policy for exporting a function from the Prelude is, roughly speaking,

  Is this function useful in small, simple examples?

The idea being that teachers, students and people writing quick scripts don't 
want to get bogged down in the module system on day 1.

Unfortunately, the definition of 'small' and 'simple' is somewhat subjective 
and we also carry some historical baggage (i.e., we don't want to remove an 
export if it still exists even if it is not very useful) so it's a bit hard 
to see the pattern of where things come from.

If you're writing a non-trivial program, you might be best importing things 
directly from the standard libraries even if it is exported by the Prelude.

Alternatively, you might consider importing things from the hierarchical 
libraries.  The advantage of the hierarchical libraries is that their 
interfaces are not frozen by the Haskell-98 definition but that is, of 
course, also their chief disadvantage.

--
Alastair Reid