Lambda over types.

Thu, 21 Mar 2002 08:35:27 -0800 (PST)

I apologise in case this doesn't make any sense.

ghc -fglasgow-exts -fallow-undecidable-instances allows 
constructs which amount to lambda abstraction over types. 
I've written a small untyped lambda calculus interpreter 
in the Haskell class/instance sublanguage, just to prove
this point. (The terms are Haskell *types*.)

Using this interpreter as a basis, and adapting it as
necessary, I can now write arbitrary "functions" [1] that take
types to types. But of course it's a pain to write them like

Maybe, after all, it does make sense to have a dedicated 
lambda-over-types Haskell extension which is convenient 
to use?

[1] - I cannot produce an equivalent of

> type Foo a b c = <some-function-over-types> a b c

but I can do an equivalent of this:

> fun :: T1 -> T2 -> T3 -> <some-function-over-types> T1 T2 T3


Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®