X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Fcompiler%2FhsSyn%2FHsDecls.lhs;h=001d4f8ada9defc27fc93750568a25e343156f53;hb=380ec6be64b1979780e78b79ca4e90b285196a28;hp=5c806a6105fe3a4c36441103ecc7d30686db9d43;hpb=aadb64aa5644f2a3ad8a645e2c7a1e72c2f61e53;p=ghc-hetmet.git diff --git a/ghc/compiler/hsSyn/HsDecls.lhs b/ghc/compiler/hsSyn/HsDecls.lhs index 5c806a6..001d4f8 100644 --- a/ghc/compiler/hsSyn/HsDecls.lhs +++ b/ghc/compiler/hsSyn/HsDecls.lhs @@ -18,7 +18,7 @@ module HsDecls ( tyClDeclName, tyClDeclNames, tyClDeclTyVars, isClassDecl, isSynDecl, isDataDecl, isIfaceSigDecl, isTypeOrClassDecl, countTyClDecls, - isSourceInstDecl, ifaceRuleDeclName, + isSourceInstDecl, instDeclDFun, ifaceRuleDeclName, conDetailsTys, collectRuleBndrSigTys, isSrcRule ) where @@ -211,6 +211,7 @@ Here's the deal. (We distinguish the two cases because source-code decls have (Just binds) in the tcdMeths field, whereas interface decls have Nothing. In *source-code* class declarations: + - When parsing, every ClassOpSig gets a DefMeth with a suitable RdrName This is done by RdrHsSyn.mkClassOpSigDM @@ -649,6 +650,9 @@ data InstDecl name isSourceInstDecl :: InstDecl name -> Bool isSourceInstDecl (InstDecl _ _ _ maybe_dfun _) = isNothing maybe_dfun + +instDeclDFun :: InstDecl name -> Maybe name +instDeclDFun (InstDecl _ _ _ df _) = df -- A Maybe, but that's ok \end{code} \begin{code} @@ -837,6 +841,7 @@ data RuleDecl name name -- Head of LHS CoreRule +isSrcRule :: RuleDecl name -> Bool isSrcRule (HsRule _ _ _ _ _ _) = True isSrcRule other = False