<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">It only works for infinite lists, though<br></blockquote>
<br>you wanted it :)<br><br><span style="font-family: courier new,monospace;">(fix $ \f xs -> case xs of { (x:_: xs) -> x : f xs; _ -> [] }) [1..10]</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">= [1,3,5,7,9]</span><br style="font-family: courier new,monospace;">
<br>here you go :)<br><br><div class="gmail_quote">2010/6/8 Yitzchak Gale <span dir="ltr"><<a href="mailto:gale@sefer.org">gale@sefer.org</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">Christopher Done wrote:<br>
> Can't forget fix in a game of code golf!<br>
><br>
>> (fix $ \f (x:_: xs) -> x : f xs) [1..]<br>
> => [1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,4...<br>
<br>
</div>Ho, good shot! It only works for infinite lists, though:<br>
<br>
Prelude> (fix $ \f (x:_: xs) -> x : f xs) [1..10]<br>
[1,3,5,7,9*** Exception: <interactive>:1:7-30: Non-exhaustive patterns in lambda<br>
<div><div></div><div class="h5"><br>
Regards,<br>
Yitz<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Ozgur Akgun<br>