Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/b43fdcfea5a80f7a6f22a92e0adc95ff25979ab9 >--------------------------------------------------------------- commit b43fdcfea5a80f7a6f22a92e0adc95ff25979ab9 Author: Simon Peyton Jones <simo...@microsoft.com> Date: Tue Jan 1 23:11:09 2013 +0000 Comments and white space only >--------------------------------------------------------------- compiler/hsSyn/HsDecls.lhs | 44 ++++++++++++++++++++++-------------- compiler/iface/TcIface.lhs | 4 +- compiler/typecheck/TcSimplify.lhs | 3 +- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs index 8ee17a5..05af165 100644 --- a/compiler/hsSyn/HsDecls.lhs +++ b/compiler/hsSyn/HsDecls.lhs @@ -818,15 +818,17 @@ pprConDecl decl@(ConDecl { con_details = InfixCon ty1 ty2, con_res = ResTyGADT { %************************************************************************ %* * -\subsection[InstDecl]{An instance declaration} + Instance declarations %* * %************************************************************************ \begin{code} --- see note [Family instance equation groups] +----------------- Type synonym family instances ------------- + +-- See note [Family instance equation groups] type LTyFamInstEqn name = Located (TyFamInstEqn name) --- | one equation in a family instance declaration +-- | One equation in a family instance declaration data TyFamInstEqn name = TyFamInstEqn { tfie_tycon :: Located name @@ -839,13 +841,16 @@ data TyFamInstEqn name type LTyFamInstDecl name = Located (TyFamInstDecl name) data TyFamInstDecl name = TyFamInstDecl - { tfid_eqns :: [LTyFamInstEqn name] -- ^ list of (possibly-overlapping) eqns - , tfid_group :: Bool -- was this declared with the "where" syntax? - , tfid_fvs :: NameSet } -- the group is type-checked as one, - -- so one NameSet will do - -- INVARIANT: tfid_group == False --> length tfid_eqns == 1 + { tfid_eqns :: [LTyFamInstEqn name] -- ^ list of (possibly-overlapping) eqns + , tfid_group :: Bool -- Was this declared with the "where" syntax? + , tfid_fvs :: NameSet } -- The group is type-checked as one, + -- so one NameSet will do + -- INVARIANT: tfid_group == False --> length tfid_eqns == 1 deriving( Typeable, Data ) + +----------------- Data family instances ------------- + type LDataFamInstDecl name = Located (DataFamInstDecl name) data DataFamInstDecl name = DataFamInstDecl @@ -857,15 +862,8 @@ data DataFamInstDecl name , dfid_fvs :: NameSet } -- free vars for dependency analysis deriving( Typeable, Data ) -type LInstDecl name = Located (InstDecl name) -data InstDecl name -- Both class and family instances - = ClsInstD - { cid_inst :: ClsInstDecl name } - | DataFamInstD -- data family instance - { dfid_inst :: DataFamInstDecl name } - | TyFamInstD -- type family instance - { tfid_inst :: TyFamInstDecl name } - deriving (Data, Typeable) + +----------------- Class instances ------------- type LClsInstDecl name = Located (ClsInstDecl name) data ClsInstDecl name @@ -880,6 +878,18 @@ data ClsInstDecl name } deriving (Data, Typeable) + +----------------- Instances of all kinds ------------- + +type LInstDecl name = Located (InstDecl name) +data InstDecl name -- Both class and family instances + = ClsInstD + { cid_inst :: ClsInstDecl name } + | DataFamInstD -- data family instance + { dfid_inst :: DataFamInstDecl name } + | TyFamInstD -- type family instance + { tfid_inst :: TyFamInstDecl name } + deriving (Data, Typeable) \end{code} Note [Family instance declaration binders] diff --git a/compiler/iface/TcIface.lhs b/compiler/iface/TcIface.lhs index 3009781..42a2e93 100644 --- a/compiler/iface/TcIface.lhs +++ b/compiler/iface/TcIface.lhs @@ -653,8 +653,8 @@ look at it. tcIfaceInst :: IfaceClsInst -> IfL ClsInst tcIfaceInst (IfaceClsInst { ifDFun = dfun_occ, ifOFlag = oflag , ifInstCls = cls, ifInstTys = mb_tcs }) - = do { dfun <- forkM (ptext (sLit "Dict fun") <+> ppr dfun_occ) $ - tcIfaceExtId dfun_occ + = do { dfun <- forkM (ptext (sLit "Dict fun") <+> ppr dfun_occ) $ + tcIfaceExtId dfun_occ ; let mb_tcs' = map (fmap ifaceTyConName) mb_tcs ; return (mkImportedInstance cls mb_tcs' dfun oflag) } diff --git a/compiler/typecheck/TcSimplify.lhs b/compiler/typecheck/TcSimplify.lhs index 18615f9..0a71198 100644 --- a/compiler/typecheck/TcSimplify.lhs +++ b/compiler/typecheck/TcSimplify.lhs @@ -799,8 +799,7 @@ solveImplication inerts , ic_wanted = wanteds , ic_info = info , ic_env = env }) - = - do { traceTcS "solveImplication {" (ppr imp) + = do { traceTcS "solveImplication {" (ppr imp) -- Solve the nested constraints -- NB: 'inerts' has empty inert_fsks _______________________________________________ Cvs-ghc mailing list Cvs-ghc@haskell.org http://www.haskell.org/mailman/listinfo/cvs-ghc