Reference types

Ashley Yakeley
Wed, 6 Feb 2002 00:51:05 -0800

At 2002-02-06 00:33, Koen Claessen wrote:

>Hm... this looks nice. With slight name changes this

Oh if you must. I decided that Refs were _so_ fundamental that anytime 
you get, set or modify anything it could probably be represented as a 
Ref, so the functions merit highly generic names. And 'read' and 'write' 
are for streams IMO.

>Not really, the m -> r is still there in practise, since you
>want to be able to use the 'readRef' and 'writeRef'
>operators, which work on the monad m, and you want them to
>work on the monad (t m).

So how is that an m -> r dependency? Nothing is stopping the programmer 
have two different kinds of reference for the same monad, and 'readRef' 
and 'writeRef' will work on any Ref.

Ashley Yakeley, Seattle WA