- k <- checkTy (tcenv,tvenv) t
- -- Makes sure GHC is eta-expanding things properly
- require (length tbs == length coTbs) $
- ("Arity mismatch between newtycon and newtype coercion: "
- ++ show tdef)
- require (k `eqKind` Klifted) ("bad kind:\n" ++ show tdef)
- axiomTvenv <- foldM (extendM Tv) eempty coTbs
- kLhs <- checkTy (tcenv,axiomTvenv) coLhs
- kRhs <- checkTy (tcenv,axiomTvenv) coRhs
+ kRhs <- checkTy (tcenv,tvenv) t
+ require (kRhs `eqKind` Klifted) ("bad kind:\n" ++ show tdef)
+ kLhs <- checkTy (tcenv,tvenv)
+ (foldl Tapp (Tcon tc) (map Tvar (fst (unzip tbs))))