Well, I want to hide the fact that I'm using ST, so if I can hide the existential type 's' it is better.

BTW, does someone know why the ST default implementation (the one exposed by Control.Monad.ST) is strict, whereas those of State et Writer are lazy?


2011/3/9 Henning Thielemann <lemming@henning-thielemann.de>

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)