<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>I personally find <br>map maySwitch (unfoldr go (x1,y1,0)) and map maySwitch $ unfoldr go (x1,y1,0) more intuitive.<br><br>I can read it as map the maySwitch function over the list generated from the unfolding.<br><br>Is there any difference in the evaluation steps between the composition version and the non-composition version?<br><br>Regards,<br>Kashyap<br></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> david48 <dav.vire+haskell@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> Ryan Ingram <ryani.spam@gmail.com><br><b><span style="font-weight:
bold;">Cc:</span></b> Johan Tibell <johan.tibell@gmail.com>; haskell-cafe@haskell.org; CK Kashyap <ck_kashyap@yahoo.com><br><b><span style="font-weight: bold;">Sent:</span></b> Friday, July 31, 2009 11:56:17 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Haskell-cafe] Need feedback on my Haskell code<br></font><br>
On Fri, Jul 31, 2009 at 5:53 AM, Ryan Ingram<<a ymailto="mailto:ryani.spam@gmail.com" href="mailto:ryani.spam@gmail.com">ryani.spam@gmail.com</a>> wrote:<br><br>> Read ($) as a parenthesis that extends as far to the right as<br>> possible; so you can write, for example:<br><br>That doesn't always work, for example :<br><br>map (+2) . map (*1) $ [1,2,3]<br>= [4,6,8]<br><br>Now replacing the $ by a parenthesis that extends as far to the right<br>as possible :<br><br>map (+2) . map (*1) ( [1,2,3] )<br><br><interactive>:1:11:<br> Couldn't match expected type `a -> [a1]'<br> against inferred type `[a2]'<br> In the second argument of `(.)', namely `map (* 2) ([1, 2, 3])'<br> In the expression: map (+ 2) . map (* 2) ([1, 2, 3])<br> In the definition of `it': it = map (+ 2) . map (* 2) ([1, 2, 3])<br></div></div></div><br>
</body></html>