[project @ 2003-05-19 15:10:40 by simonpj]
[ghc-hetmet.git] / ghc / compiler / hsSyn / HsDecls.lhs
index 5c806a6..001d4f8 100644 (file)
@@ -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