Hi Daryoush,<br><br>I recommend you try these experiments first, and then reply back if you're still confused.<br><br>:t max<br><br>:t (+1)<br><br>:t max . (+1)<br><br>:t (+1) 2<br><br>:t (.)<br><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Nov 16, 2012 at 7:10 AM, Daryoush Mehrtash <span dir="ltr"><<a href="mailto:dmehrtash@gmail.com" target="_blank">dmehrtash@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>I am having hard time understanding how removing the outer parenthesis in</div><div><br></div><div>(max.(+1)) 2 2 </div><div><br></div><div>to </div><div><br></div><div>max.(+1) 2 2 </div><div><br></div><div>changes the meaning of expression.</div>
<div><br></div><div>My expectation was that "max.(+1) takes two numbers and returns the max as defined in the type:</div><div><br></div><div><div>:t max.(+1)</div><div>max.(+1) :: (Ord b, Num b) => b -> b -> b</div>
</div><div><br></div><div><br></div><div><br></div><div>With parenthesis it does what I expect it to:</div><div><br></div><div><br></div><div>Prelude> :t (max.(+1)) 2 2</div><div>(max.(+1)) 2 2 :: (Ord b, Num b) => b</div>
<div>Prelude> (max.(+1)) 2 2</div><div>3</div><div><br></div><div><br></div><div>But if I remove the parenthesis I get a beast that I have no idea what its type signature mean any more</div><div><br></div><div>Prelude> :t (max.(+1)) 2 2</div>
<div>(max.(+1)) 2 2 :: (Ord b, Num b) => b</div><div>Prelude> :t max.(+1) 2 2</div><div>max.(+1) 2 2 :: (Ord b, Num a1, Num (a1 -> a -> b)) => a -> b -> b</div><div><br></div><div><br></div><div>How did removal of parenthesis changed the meaning? How do you interpret the type: "(Ord b, Num a1, Num (a1 -> a -> b)) => a -> b -> b"?</div>
<div><br></div><div>Thanks</div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div><div><br></div>-- <br>Daryoush<br><br>Weblog: <a href="http://onfp.blogspot.com/" target="_blank">http://onfp.blogspot.com/</a><br>
</font></span><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><br>
<br></blockquote></div><br></div>