Okay but we have:

   ST s a

   and:

   runState :: State s a -> (a,s)

runST :: (forall s . ST s a) -> a -- notice no "s" in the return type:

so what about:

runSTT :: (forall s . ST s m a) -> m a -- no s gets out (like with ST not State)

After all there was the proposal to merge (IO a) and (StateT RealWorld a)

   Keean.


Udo Stenzel wrote:

Ahh, but:

runSTT :: Monad m => STT s m a -> m (a,s)


Keean Schupke <[EMAIL PROTECTED]> schrieb am 20.12.04 15:17:14:



Surely if IO is (ST RealWorld a) then (StateT RealWorld m a) is more or less the right thing?



Not at all, since ST and StateT are completely unrelated. What signature would runSTT have? Either it exposed the contained state (the RealWorld!):

runSTT :: Monad m => STT s m a -> m (a,s)

or it drops the state:

runSTT :: Monad m => STT s m a -> m a

The former is a bad idea, the latter is useless as it can be implemented by
running the ordinary runST inside m.  Note that runStateT uses the former
signature and would expose RealWorld, if it could be instantiated at RealWorld.


Udo.

__________________________________________________________
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201




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

Reply via email to