On Jan 3, 2008 6:08 AM, Achim Schneider <
barsoap@web.de> wrote:
Achim Schneider <barsoap@web.de> wrote:
> [...]
I'm trying to grok that
[] = id
++ = .
in the context of Hughes lists.
I guess it would stop to slip away if I knew what : corresponds to.
Well, (:) has type a -> [a] -> [a], so a function corresponding to (:) for Hughes lists should have type
foo :: a -> H a -> H a
that is,
foo :: a -> ([a] -> [a]) -> [a] -> [a]
so it can be written
foo x h = (x:) . h
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 (.).
-Brent