Hello Gregory,

Thursday, August 24, 2006, 7:29:47 PM, you wrote:

> it seems that unsafeIOToST is safe in this case, in the sense that

why you are stuck to ST monad? isn't it better to use just IO monad?

and about total style - again, you can use my lib or write this
yourself so that all you reference operations will work independent on
Monad used and you can freely experiment with different monads without
rewriting whole code:

class Ref m r | m->r where
  newRef
  readRef
  writeRef

instance Ref IO IORef
  writeRef r x = writeIORef r $! x

instance (Ref m r) => Ref (WriterT m) r where
  writeRef = lift . writeRef

and so on...

ps to Brian: it is why i was so interested in your idea. writing
monad-independent code, including code that can be applied to any
monad lifted from ST or IO, looks for me very promising idea, somewhat
that will be widely used in future


-- 
Best regards,
 Bulat                            mailto:[EMAIL PROTECTED]

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to