diff options
| author | simonpj@microsoft.com <unknown> | 2009-05-27 18:00:32 +0000 |
|---|---|---|
| committer | simonpj@microsoft.com <unknown> | 2009-05-27 18:00:32 +0000 |
| commit | 857847a660defd9f7480894c01f0c70f611c373a (patch) | |
| tree | 7a088dba3c0c53b4ee595dc8882d20daa565f615 /compiler | |
| parent | e598b8f91d1886cd6cab2e07efa6749fe4035614 (diff) | |
| download | haskell-857847a660defd9f7480894c01f0c70f611c373a.tar.gz | |
Rename conDeclsNames to hsConDeclsNames, and export it
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/hsSyn/HsDecls.lhs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/hsSyn/HsDecls.lhs b/compiler/hsSyn/HsDecls.lhs index cd04a1a7e0..832f6165ff 100644 --- a/compiler/hsSyn/HsDecls.lhs +++ b/compiler/hsSyn/HsDecls.lhs @@ -42,7 +42,7 @@ module HsDecls ( CImportSpec(..), FoType(..), -- ** Data-constructor declarations ConDecl(..), LConDecl, ResType(..), ConDeclField(..), - HsConDeclDetails, hsConDeclArgTys, + HsConDeclDetails, hsConDeclArgTys, hsConDeclsNames, -- ** Document comments DocDecl(..), LDocDecl, docDeclDoc, -- ** Deprecations @@ -548,7 +548,7 @@ tyClDeclNames (ClassDecl {tcdLName = cls_name, tcdSigs = sigs, tcdATs = ats}) concatMap (tyClDeclNames . unLoc) ats ++ [n | L _ (TypeSig n _) <- sigs] tyClDeclNames (TyData {tcdLName = tc_name, tcdCons = cons}) - = tc_name : conDeclsNames (map unLoc cons) + = tc_name : hsConDeclsNames cons tyClDeclTyVars :: TyClDecl name -> [LHsTyVarBndr name] tyClDeclTyVars (TyFamily {tcdTyVars = tvs}) = tvs @@ -741,21 +741,21 @@ data ResType name \end{code} \begin{code} -conDeclsNames :: (Eq name) => [ConDecl name] -> [Located name] +hsConDeclsNames :: (Eq name) => [LConDecl name] -> [Located name] -- See tyClDeclNames for what this does -- The function is boringly complicated because of the records -- And since we only have equality, we have to be a little careful -conDeclsNames cons +hsConDeclsNames cons = snd (foldl do_one ([], []) cons) where - do_one (flds_seen, acc) (ConDecl { con_name = lname, con_details = RecCon flds }) + do_one (flds_seen, acc) (L _ (ConDecl { con_name = lname, con_details = RecCon flds })) = (map unLoc new_flds ++ flds_seen, lname : new_flds ++ acc) where new_flds = filterOut (\f -> unLoc f `elem` flds_seen) (map cd_fld_name flds) - do_one (flds_seen, acc) c - = (flds_seen, (con_name c):acc) + do_one (flds_seen, acc) (L _ (ConDecl { con_name = lname })) + = (flds_seen, lname:acc) \end{code} |
