[Haskell-cafe] Custom monad using ST

Henning Thielemann lemming at henning-thielemann.de
Wed Mar 9 21:41:34 CET 2011


On Wed, 9 Mar 2011, Yves Parès wrote:

> Hello,
> 
> I am trying to make a monad that uses ST internally.
> But even when reducing this to the simplest case I'm still cramped by the 's' phantom
> type :
> 
> {-# LANGUAGE Rank2Types #-}
> 
> newtype MyST a = MyST (forall s. ST s a)
> -- ^ I cannot use " deriving (Monad) " through GeneralizedNewtypeDeriving

Would it make sense to make the 's' type explicit?

newtype MyST s a = MyST (ST s a)



More information about the Haskell-Cafe mailing list