Evaluating the argument/result was my intention. Evaluating the computation itself might be useful in some cases, though.<div><br></div><div>Regards,</div><div><br></div><div>Dave<br><div><br><div class="gmail_quote">On Sat, Jan 21, 2012 at 3:20 PM, Yves Parès <span dir="ltr"><<a href="mailto:yves.pares@gmail.com">yves.pares@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">> (StrictT op) >>= f = StrictT (op >>= \ x -> x `seq` runStrictT (f x))<br><br></div>
Are you sure? Here you evaluate the result, and not the computation itself.<br>Wouldn't it be:<br><br>(StrictT op) >>= f = op ` seq` StrictT (op >>= \x -> runStrictT (f x))<br>
<br>??<br><br><div class="gmail_quote">2012/1/21 David Barbour <span dir="ltr"><<a href="mailto:dmbarbour@gmail.com" target="_blank">dmbarbour@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">
<div class="gmail_quote"><div>On Sat, Jan 21, 2012 at 10:08 AM, Roman Cheplyaka <span dir="ltr"><<a href="mailto:roma@ro-che.info" target="_blank">roma@ro-che.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* David Barbour <<a href="mailto:dmbarbour@gmail.com" target="_blank">dmbarbour@gmail.com</a>> <a href="tel:%5B2012-01-21%2010" value="+12012012110" target="_blank">[2012-01-21 10</a>:01:00-0800]<br>
<div>> As noted, IO is not strict in the value x, only in the operation that<br>
> generates x. However, should you desire strictness in a generic way, it<br>
> would be trivial to model a transformer monad to provide it.<br>
<br>
</div>Again, that wouldn't be a monad transformer, strictly speaking, because<br>
"monads" it produces violate the left identity law.<br></blockquote><div><br></div></div><div>It meets the left identity law in the same sense as the Eval monad from Control.Strategies.</div><div> <a href="http://hackage.haskell.org/packages/archive/parallel/3.1.0.1/doc/html/src/Control-Parallel-Strategies.html#Eval" target="_blank">http://hackage.haskell.org/packages/archive/parallel/3.1.0.1/doc/html/src/Control-Parallel-Strategies.html#Eval</a></div>
<div><br></div><div>That is, so long as values at each step can be evaluated to WHNF, it remains true that `return x >>= f` = f x.</div><div><br></div><div>I did mess up the def of >>=. I think it should be:</div>
<div> (StrictT op) >>= f = StrictT (op >>= \ x -> x `seq` runStrictT (f x))</div><div><br></div><div>But I'm not interested enough to actually pull out an interpreter and test...</div><div><br></div><div>
Regards,</div><div><br></div><div>Dave</div><div><br></div></div>
<br></div></div><div class="im">_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
<br></div></blockquote></div><br>
</blockquote></div><br></div></div>