categories - Category Theory list
 help / color / mirror / Atom feed
* Recursive types in polymorphic lambda calculus
@ 1999-05-14 19:24 Philip Wadler
  0 siblings, 0 replies; 2+ messages in thread
From: Philip Wadler @ 1999-05-14 19:24 UTC (permalink / raw)
  To: types, categories

There is a fairly standard encoding of recursive types
into polymorphic lambda calculus, given by

	rec X.F[X]  =  all X.(F[X] -> X) -> X

where F[X] is a type in which the type variable X appears only
covariantly.  Recall that every covariant type corresponds to a
covariant functor, so for every h:X->Y we have F[h]:F[X]->F[Y].
If we abbreviate T = rec X.F[X], then the key functions on this
type are given by the polymorphic lambda terms:

	fold : all X.(F[X] -> X) -> T -> X
	fold = Lam X.lam k:F[X]->X.lam t:T.t{X}(k)

	in   : F[T] -> T
	in   = lam u:F[T].Lam X.lam k:F[X]->X.k(F[fold{X}(k)](u))

	out  : T -> F[T]
	out  = fold{F[T]}(F[in])

Questions: Who first had this insight?  Where is a good place to find
this spelled out in the literature?  Please send results to me, and I
will summarize them for the list.  Cheers, -- P



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-05-31 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <199905151242.IAA02714@saul.cis.upenn.edu>
1999-05-31 16:09 ` Recursive types in polymorphic lambda calculus Philip Wadler
1999-05-14 19:24 Philip Wadler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).