On Tue, Oct 11, 2005 at 05:25:24PM -0700, [EMAIL PROTECTED] wrote: > First we define the representation of a list as a fold: > > > newtype FR a = FR (forall ans. (a -> ans -> ans) -> ans -> ans) > > unFR (FR x) = x > > It has a rank-2 type. The defining equations are: if flst is a value > of a type |FR a|, then > unFR flst f z = z if flst represents an empty list > unFR flst f z = f e (unFR flst' f z) > if flst represents the list with the head 'e' > and flst' represents the rest of that list
Presumably you noticed that this is isomorphic to the representation of a list in lambda calculus, right? Peace, Dylan
signature.asc
Description: Digital signature
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell