Global variables?
Andrew J Bromage
ajb@spamcop.net
Mon, 3 Feb 2003 10:49:06 +1100
G'day all.
On Fri, Jan 31, 2003 at 09:08:22AM +0100, Ralf Hinze wrote:
> John Hughes wrote a nice pearl on the subject, see
>
> http://www.math.chalmers.se/~rjmh/Globals.ps
Nice! Why isn't RefMonad in hslibs?
Possibly because of the class signature:
class Monad m => RefMonad m r | m -> r where
{- etc -}
It makes perfect sense for there to be more than one kind of "ref"
for a given monad. Indeed, sometimes it's important. Quite often, I
use a custom ref built on top of IORef which supports Ord, as this is
needed for hash consing.
Cheers,
Andrew Bromage