Achim Schneider <[EMAIL PROTECTED]> wrote: > "Brent Yorgey" <[EMAIL PROTECTED]> wrote: > > > > > Well, (:) has type a -> [a] -> [a], so a function corresponding to > > (:) for Hughes lists should have type > > > > foo :: a -> H a -> H a > > > > [...] > > 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 (.). > > > Yes, I did. > > They key was not thinking that : has type > > (:) :: a -> a -> [a] > > , or, put differently, beat the lisp out of me, thanks. > What the hell am I talking about?
(define (cons x y) (lambda (m) (m x y))) (define (car z) (z (lambda (p q) p))) (define (cdr z) (z (lambda (p q) q))) : is, in a sense, \. -- (c) this sig last receiving data processing entity. Inspect headers for past copyright information. All rights reserved. Unauthorised copying, hiring, renting, public performance and/or broadcasting of this signature prohibited. _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
