On Mar 11, 2011, at 7:37 PM, Luke Palmer wrote:
> On Fri, Mar 11, 2011 at 8:18 PM, Joshua Ball wrote:
>> Suppose I want the following functions:
>>
>> newRef :: a -> RefMonad (Ref a)
>> readRef :: Ref a -> RefMonad a
>> writeRef :: Ref a -> a -> RefMonad ()
>
> I would be delighted to see a pure
On Fri, Mar 11, 2011 at 8:18 PM, Joshua Ball wrote:
> Suppose I want the following functions:
>
> newRef :: a -> RefMonad (Ref a)
> readRef :: Ref a -> RefMonad a
> writeRef :: Ref a -> a -> RefMonad ()
Assuming this is a pure interface, you need one more thing:
runRefMonad :: RefMonad a -> a
T
Hi,
Suppose I want the following functions:
newRef :: a -> RefMonad (Ref a)
readRef :: Ref a -> RefMonad a
writeRef :: Ref a -> a -> RefMonad ()
for some appropriate data Ref = ...
Obviously these functions are already satisfied by IORefs and STM.
But if I wanted to implement my own (for fun).