Suggestion for module system (to get rid of many uses of unsafePerformIO)

Stephen Dolan stedolan at
Wed May 23 11:43:58 EDT 2007

> I think what you're describing seems to be so completely different
> from Haskell as it is now that that people either don't understand
> it, or they do understand it and do think it's downright silly, but
> are just too polite to say that. Maybe you should try writing it up
> in a more comprehensible form on a Haskell wiki page.

Yeah, that certainly wasn't my most readable piece of writing.

> I would say that I get worried when people talk about "module
> initialisation" and/or (potentially) side effecting imports. I'm
> not sure if this is a problem with what you're proposing, but
> I think it's important that we don't get into a situation where
> the mere presence or absence of some definition in a module can
> influence program behaviour, even if it isn't referenced by main
> somehow.

No, the point of what I was proposing was that, when a module requires
side-effecting initialisation, it would have to be imported inside a
do block like any other side-effecting piece of code. At the moment,
we have the situation of modules using unsafePerformIO newIORef, which
influences program behaviour without being referenced by main. If the
import statement was inside a do block, it would be clear when the
side-effects are taking place.

Stephen Dolan

More information about the Haskell-prime mailing list