Well, I want to hide the fact that I'm using ST, so if I can hide the existential type 's' it is better.<br><br>BTW, does someone know why the ST default implementation (the one exposed by <a href="http://Control.Monad.ST">Control.Monad.ST</a>) is strict, whereas those of State et Writer are lazy?<br>
<br><br><div class="gmail_quote">2011/3/9 Henning Thielemann <span dir="ltr"><<a href="mailto:lemming@henning-thielemann.de">lemming@henning-thielemann.de</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im"><br>
On Wed, 9 Mar 2011, Yves Parès wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello,<br>
<br>
I am trying to make a monad that uses ST internally.<br>
But even when reducing this to the simplest case I'm still cramped by the 's' phantom<br>
type :<br>
<br>
{-# LANGUAGE Rank2Types #-}<br>
<br>
newtype MyST a = MyST (forall s. ST s a)<br>
-- ^ I cannot use " deriving (Monad) " through GeneralizedNewtypeDeriving<br>
</blockquote>
<br></div>
Would it make sense to make the 's' type explicit?<br>
<br>
newtype MyST s a = MyST (ST s a)<br>
<br>
</blockquote></div><br>