> Btw, I get a bad feeling about this Global thing. I'm worried
> we're introducing ugly hacks just so we can solve problems _our_
> way and not the Haskell way.
I'm a supporter of this, but then I'm not a Haskeller by trade. So
take the following with a pinch of salt.
You need to distinguish between Tomasz's AtExit stuff, and the other
uses of unsafePerformIO.
While internally AtExit is somewhat frightening, it is a perfectly
pure interface. It compensates for the lack, in Haskell, of global
imperative variables. Note that we're not speaking here about
anything that can be used unsafely: we're speaking about a global
IORef that can be accessed from the IO monad only.
The other uses consist in using unsafePerformIO to access
non-functional data that are guaranteed to never change during an
execution of Darcs. Examples of this are the contents of slurpies
(guaranteed by the lock that darcs puts on repositories), or Eric's
various flags related to ssh.
While I happen to like the latter usage, I guess it could be replaced
by the use of dynamically-scoped variables (``special variables'' if
you're a Lisp person). Unfortunately, the way dynamic variables are
implemented in ghc (``implicit parameters'') makes them completely
useless.
(Note that there is no good solution here: dynamic variables are
either completely useless, as in ghc, or they need to be severely
restricted (made monomorphic, I guess), or they break the type system.
Pick your poison.)
Juliusz
_______________________________________________
darcs-devel mailing list
[email protected]
http://www.abridgegame.org/cgi-bin/mailman/listinfo/darcs-devel