On Thu, Jan 1, 2009 at 1:31 PM, David Menendez <span dir="ltr">&lt;<a href="mailto:dave@zednenem.com">dave@zednenem.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/1/1 Luke Palmer &lt;<a href="mailto:lrpalmer@gmail.com">lrpalmer@gmail.com</a>&gt;:<br>
<div class="Ih2E3d">&gt;<br>
&gt; So that&#39;s the answer: there already is a Strict monad. &nbsp;And an attempt to<br>
&gt; make a lazier one strict just results in breaking the monad laws.<br>
<br>
</div>There is at least one transformer that will make a strict monad out of<br>
a non-strict monad.<br>
<br>
newtype CPS m a = CPS { unCPS :: forall b. (a -&gt; m b) -&gt; m b }</blockquote><div><br>I have heard this called the &quot;codensity monad&quot; (and it appears under that name in category-extras).&nbsp; Good observation.<br>
<br>In my reply I missed the important consideration of the strictness of (&gt;&gt;=), irrsepective of the values.&nbsp; While you can not force values to be strict in a monad without breaking a law, (&gt;&gt;=) is &quot;up for grabs&quot;, and that&#39;s what people are referring to when they refer to strict and lazy monads.&nbsp; <br>
<br>So I guess &quot;strict monad&quot; means (&gt;&gt;= f) is strict for all f.&nbsp;&nbsp; Right?<br><br>Luke<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
&gt; There&#39;s another answer though, regarding your question for why we don&#39;t just<br>
&gt; use StrictT State instead of a separate State.Strict. &nbsp;This message is<br>
&gt; already too long, and I suspect this will be the popular reply anyway, but<br>
&gt; the short answer is that Strict State is called that because it is strict in<br>
&gt; its state, not in its value.<br>
<br>
</div>No, Control.Monad.State.Strict and Control.Monad.State.Lazy never<br>
force evaluation of their states.<br>
<br>
Control.Monad.State.Strict&gt; evalState (put undefined) &#39;0&#39;<br>
()</blockquote><div><br>My mistake.&nbsp; <br><br>Luke<br></div></div><br>