X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcEnv.lhs;h=1d093e2e7c4d1aa2a2760c25def972c16e72be7a;hb=63c79c1d87a235808c3efcb4983eb5411572b6d3;hp=19deca9e4c1eb4c43d0270bae916f1f9f8cf1f8b;hpb=3e83dfb21b2f2220dce97427fff5c19459ae68d1;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcEnv.lhs b/compiler/typecheck/TcEnv.lhs index 19deca9..1d093e2 100644 --- a/compiler/typecheck/TcEnv.lhs +++ b/compiler/typecheck/TcEnv.lhs @@ -45,19 +45,19 @@ module TcEnv( import HsSyn ( LRuleDecl, LHsBinds, LSig, LHsTyVarBndr, HsTyVarBndr(..), pprLHsBinds, - ExprCoFn(..), idCoercion, (<.>) ) + idCoercion, (<.>) ) import TcIface ( tcImportDecl ) import IfaceEnv ( newGlobalBinder ) import TcRnMonad import TcMType ( zonkTcType, zonkTcTyVarsAndFV ) -import TcType ( Type, TcKind, TcTyVar, TcTyVarSet, TcType, TvSubst, - substTy, substTyVar, tyVarsOfType, tcTyVarsOfTypes, mkTyConApp, +import TcType ( Type, TcKind, TcTyVar, TcTyVarSet, TcType, + substTy, tyVarsOfType, tcTyVarsOfTypes, mkTyConApp, getDFunTyKey, tcTyConAppTyCon, tcGetTyVar, mkTyVarTy, tidyOpenType, isRefineableTy ) import TcGadt ( Refinement, refineType ) import qualified Type ( getTyVar_maybe ) -import Id ( idName, isLocalId, setIdType ) +import Id ( idName, isLocalId ) import Var ( TyVar, Id, idType, tyVarName ) import VarSet import VarEnv @@ -565,7 +565,9 @@ data InstBindings [LSig Name] -- User pragmas recorded for generating -- specialised instances - | NewTypeDerived -- Used for deriving instances of newtypes, where the + | NewTypeDerived + TyCon -- tycon for the newtype + -- Used for deriving instances of newtypes, where the [Type] -- witness dictionary is identical to the argument -- dictionary. Hence no bindings, no pragmas -- The [Type] are the representation types @@ -576,7 +578,7 @@ pprInstInfo info = vcat [ptext SLIT("InstInfo:") <+> ppr (idType (iDFunId info)) pprInstInfoDetails info = pprInstInfo info $$ nest 2 (details (iBinds info)) where details (VanillaInst b _) = pprLHsBinds b - details (NewTypeDerived _) = text "Derived from the representation type" + details (NewTypeDerived _ _) = text "Derived from the representation type" simpleInstInfoClsTy :: InstInfo -> (Class, Type) simpleInstInfoClsTy info = case instanceHead (iSpec info) of