Types used in the type checker

type Type i = HsTypeI i
type Pred i = Type i
data Qual i t = [Pred i] :=> t
data Scheme v = Forall [v] (Qual v (Type v))
data Typing x t = x :>: t deriving (Eq,Show)
type Assump i = Typing (HsIdentI i) (Scheme i)
type Typed i x = Typing x (Type i)
newtype Subst i = S [(i,Type i)] deriving (Show)

data Kind = K (K Kind) | Kvar KVar
newtype KVar = KVar Int

class TypeVar v => Types v t | t->v where
  tmap :: (Type v->Type v) -> t -> t
  apply :: Subst v -> t -> t
  tv :: t -> Set v

  apply = tmap . applySubst