== Representing closure-converted types as indexed types == The
idea is to use a class {{{ class CC a where data CConv a --
closure converted 'a' to :: a -> CConv a fr :: CConv a -> a }}}
The most interesting instance is that for functions, which reads
{{{ data Clo a b = forall e. Clo (e -> a -> b) e class (CC a, CC
b) => CC (a -> b) where data CConv (a -> b) = CCArrow (Clo
(CConv a) (CConv b)) to f = CCArrow (Clo (\_ -> f) ()) fr
(CCArrow (Clo f e)) = f e }}} For all basic types, we want
something like the following: {{{ instance CC Int where newtype
CConv Int = CCInt Int to = CCInt fr (CCInt x) = x }}} In fact,
we want something like that for all types that are defined in
modules that are not closure-converted. Unfortunately,
associated ''data'' types cannot have defaults. (Also note that
we use here a `newtype instance` for a `data` family. Something,
which should be easy to add to GHC's implementation of
associated types, but isn't allowed right now.) === User-defined
types === When we encounter a data ty