[Haskell-cafe] Re: [Haskell] Re: Global Variables and IO initializers

Keean Schupke k.schupke at imperial.ac.uk
Sun Nov 7 11:41:24 EST 2004


I might really want to call the initialisation twice. If you use global
variables, the library can only be initialised once... but what if I
really want to use the library twice? With the state in a type passed
between functions, you can have multiple different states active
at once.

    Keean.

Benjamin Franksen wrote:

>Yes, whenever possible I would use this approach. Unfortunately, there are 
>libraries (or just modules) that need to do some IO action in order to 
>produce the (A)DT. In this case it _will_ make a difference how often you 
>call it. But then this is just how IO actions are by nature, isn't it?
>
>Ben
>  
>



More information about the Haskell-Cafe mailing list