<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Yes, sorry, GHC&#8217;s strictness analyzer. <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>What I meant with this email is that I guess that for a
strictness analyzer, the information that a function is strict in an argument *<b>independent
from the other arguments</b>* would not be good enough in itself for
optimization, it would be better to also use the dependencies between the
arguments (as in the case of the if&#8230;then&#8230;else). <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>It seems one can indicate in GHC that an argument is strict using
annotiations, but I don&#8217;t see a way of specifying these dependencies
(maybe this does not make sense, and this is all newbie nonsense). Of course,
with whole program optimization this would not be necessary, but if the
compiler just sees the function signature, he must assume that a lazy argument
is always lazy, independent of the value of other strict arguments no?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Cheers,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Peter<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
lennart.augustsson@gmail.com [mailto:lennart.augustsson@gmail.com] <b>On Behalf
Of </b>Lennart Augustsson<br>
<b>Sent:</b> maandag 11 februari 2008 0:28<br>
<b>To:</b> Peter Verswyvelen<br>
<b>Cc:</b> haskell-cafe@haskell.org<br>
<b>Subject:</b> Re: [Haskell-cafe] Newbie question: mutually exclusive strict /
lazy<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal style='margin-bottom:12.0pt'>I'm not sure what you mean by
&quot;the strictness analyzer&quot;.&nbsp; GHC's strictness analyzer?<br>
I don't know, but I would hope so since it was done already in 1980 by Alan
Mycroft.<br>
<br>
&nbsp; -- Lennart<o:p></o:p></p>

<div>

<p class=MsoNormal>On Sat, Feb 9, 2008 at 4:33 PM, Peter Verswyvelen &lt;<a
href="mailto:bf3@telenet.be">bf3@telenet.be</a>&gt; wrote:<o:p></o:p></p>

<p class=MsoNormal>Consider the function<br>
<br>
cond x y z = if x then y else z<br>
<br>
I guess we can certainly say cond is strict in x.<br>
<br>
But what about y and z?<br>
<br>
If x is true, &nbsp;then cond is strict in y<br>
If x is false, then cond is strict in z<br>
<br>
So we can't really say cond is lazy nor strict in its second or third argument.<br>
<br>
Of course, this is the case for many more functions, but in &nbsp;the case of
the if-then-else primitive, does the strictness analyzer make use of this
&quot;mutually exclusive strictness&quot; fact?<br>
<br>
Cheers,<br>
Peter<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">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><o:p></o:p></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</body>

</html>