<div dir="ltr"><div class="gmail_default" style="font-size:large">lazyness....?<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Dec 23, 2018 at 8:40 AM Tom Ellis <<a href="mailto:tom-lists-haskell-cafe-2017@jaguarpaw.co.uk">tom-lists-haskell-cafe-2017@jaguarpaw.co.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, Dec 22, 2018 at 09:52:18AM +0100, Damien Mattei wrote:<br>
> i have inserted trace statement that output variable<br>
> ... i have strange behavior of output:<br>
<br>
Let's take a simpler example. Do you understand why the trace statments<br>
from this small program appear in the order that they do? (And for what<br>
it's worth I really think you'll be better off writing programs using do<br>
notation).<br>
<br>
<br>
% cat test.hs<br>
import Debug.Trace<br>
<br>
result =<br>
let a = trace "evaluating a" 2<br>
b = trace "evaluating b" 10<br>
c = trace "evaluating c" (a + b)<br>
in c<br>
~% ghci -e result test.hs<br>
evaluating c<br>
evaluating b<br>
evaluating a<br>
12<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>