...follows: if t has hnf \Lambda x1 : : : xm ! z u1 : : : un , then BT(t) = \Lambda x1 : : : xm ! z BT(u1) \Deltas\Deltas\DeltasBT(un) : For a more formal treatment of B"ohm trees we refer the reader to =-=[2]-=-. Now, from a generic programming point of view we can identify type terms that have the same B"ohm trees, i.e., t = u if BT(t) = BT(u). We have, for instance, Rose = GRose (\Lambda a ! Fix (BaseList ...

...able candidates are the intermediate language of the Glasgow Haskell Compiler [38], which is based on the secondorder *-calculus [11], or the language Henk [39], which is based on Barendregt's *-cube =-=[3]-=-. 9ssizeList :: 8a:(8x:a x ! Int) ! (8x :List (a x ) ! Int) sizeList sizea = sizel where sizel Nil = 0 sizel (Cons x xs) = sizea x + sizel xs sizeRose :: 8a:(8x:a x ! Int) ! (8x :Rose (a x ) ! Int) si...

...d this problem by using encodings into a universal datatype [45] or by using dynamic types and a 1The definition of enc exhibits \Theta (n2) worst-case behaviour, but this is easy to remedy. typecase =-=[1]-=-, the result would be rather inefficient because enc would repeatedly interpret its type argument. By specializing enchti for a given t we remove this interpretative layer. As an aside, one could argu...

...nstrate the expressiveness of Haskell's type system and to give evidence that real use has been made of these features. As first, rather simple examples consider the datatypes of lists and rose trees =-=[4]-=-. data List a = Nil j Cons a (List a) data Rose a = Branch a (List (Rose a)) The two equations introduce two type constructors, List and Rose, of kind ? ! ?. The kind system of Haskell specifies the `...