[Haskell-cafe] Re: Yet another IO initializer: Effectful declarations and an ACIO monad

Jules Bean jules at jellybean.co.uk
Fri Nov 26 09:12:57 EST 2004

On 26 Nov 2004, at 12:08, George Russell wrote:

> >  Yes, you need to explicitly initialise it; but you don't need then 
> to
> >  pass the initialized handle all around your code.  The painful 
> plumbing
> >  goes away.
> I think this is either unwieldy or inefficient. Imagine a large library
> containing lots of these things which need to be initialised if used.  
> Then
> I predict that one of two things will happen
> (a) people will end up writing boilerplace code at the start of the 
> main
>     action which does
>        initialise1
>        initialise2
>        ... blah blah ...
> (b) (more likely).  There will be a single initialisation function for 
> the
>     library, which initialises everything, even the stuff you don't 
> actually
>     want.

To me this seems perfectly fine. Ian's proposal gets us TWIs, which I 
can see the need for. Implicit initialisation (i.e. stateful 
initialisation functions happening non-deterministicly, like java 
static{} blocks or C++'s similar feature) is a can of worms I currently 
see no value in opening.


More information about the Haskell-Cafe mailing list