|
Re: Church' List constructors (was: "Green Card" ...): msg#00093lang.haskell.general
Marcin 'Qrczak' Kowalczyk wrote: | newtype List a = List (forall b. b -> (a -> List a -> b) -> b) | | nil = List (\fornil forcons -> fornil) | cons x xs = List (\fornil forcons -> forcons x xs) | forlist fornil forcons (List ls) = ls fornil forcons : | In ghc algebraic types are really implemented in a similar way :-) Well, not really. This implementation does not give you sharing between lists. Everytime you use "forlist", the list is reevaluated. In GHC, this does not happen of course. Regards, Koen. -- Koen Claessen http://www.cs.chalmers.se/~koen phone:+46-31-772 5424 mailto:koen@xxxxxxxxxxxxxx ----------------------------------------------------- Chalmers University of Technology, Gothenburg, Sweden |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | RE: "Green Card" for untyped lambda calculus?: 00093, Mark P Jones |
|---|---|
| Next by Date: | MBR'01 Deadline extension: 00093, Lorenzo Magnani |
| Previous by Thread: | Re: "Green Card" for untyped lambda calculus?i: 00093, Marcin 'Qrczak' Kowalczyk |
| Next by Thread: | RE: "Green Card" for untyped lambda calculus?: 00093, Mark P Jones |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |