<br><div class="gmail_quote">On Jan 3, 2008 6:08 AM, Achim Schneider <<a href="mailto:barsoap@web.de">barsoap@web.de</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Achim Schneider <<a href="mailto:barsoap@web.de">barsoap@web.de</a>> wrote:<br><br>> [...]<br><br>I'm trying to grok that<br><br>[] = id<br>++ = .<br><br>in the context of Hughes lists.<br><br>I guess it would stop to slip away if I knew what : corresponds to.
<br><div><div></div><div class="Wj3C7c"></div></div></blockquote><br>Well, (:) has type a -> [a] -> [a], so a function corresponding to (:) for Hughes lists should have type<br><br>foo :: a -> H a -> H a<br><br>
that is,<br><br>foo :: a -> ([a] -> [a]) -> [a] -> [a]<br><br>so it can be written<br><br>foo x h = (x:) . h<br><br>which lambdabot informs me can also be written as (.) . (:). But in the end I'm not sure how helpful that is for understanding Hughes lists! I think the key sentence from the paper is this: "by representing a list xs as the function (xs ++) that appends this list to another list that has still to be supplied." If you understand that sentence, then you can understand why [] is id and (++) is (.).
<br><br>-Brent<br><br></div>