-renameSig lookup_occ_nm (Sig v ty src_loc)
- = pushSrcLocRn src_loc $
- lookup_occ_nm v `thenRn` \ new_v ->
- rnHsSigType (quotes (ppr v)) ty `thenRn` \ (new_ty,fvs) ->
- returnRn (Sig new_v new_ty src_loc, fvs `addOneFV` new_v)
-
-renameSig _ (SpecInstSig ty src_loc)
- = pushSrcLocRn src_loc $
- rnHsSigType (text "A SPECIALISE instance pragma") ty `thenRn` \ (new_ty, fvs) ->
- returnRn (SpecInstSig new_ty src_loc, fvs)
-
-renameSig lookup_occ_nm (SpecSig v ty src_loc)
- = pushSrcLocRn src_loc $
- lookup_occ_nm v `thenRn` \ new_v ->
- rnHsSigType (quotes (ppr v)) ty `thenRn` \ (new_ty,fvs) ->
- returnRn (SpecSig new_v new_ty src_loc, fvs `addOneFV` new_v)
-
-renameSig lookup_occ_nm (FixSig (FixitySig v fix src_loc))
- = pushSrcLocRn src_loc $
- lookup_occ_nm v `thenRn` \ new_v ->
- returnRn (FixSig (FixitySig new_v fix src_loc), unitFV new_v)
-
-renameSig lookup_occ_nm (DeprecSig v txt src_loc)
- = pushSrcLocRn src_loc $
- lookup_occ_nm v `thenRn` \ new_v ->
- returnRn (DeprecSig new_v txt src_loc, unitFV new_v)
-
-renameSig lookup_occ_nm (InlineSig v p src_loc)
- = pushSrcLocRn src_loc $
- lookup_occ_nm v `thenRn` \ new_v ->
- returnRn (InlineSig new_v p src_loc, unitFV new_v)
-
-renameSig lookup_occ_nm (NoInlineSig v p src_loc)
- = pushSrcLocRn src_loc $
- lookup_occ_nm v `thenRn` \ new_v ->
- returnRn (NoInlineSig new_v p src_loc, unitFV new_v)
+renameSigs :: [LSig RdrName] -> RnM [LSig Name]
+renameSigs sigs = mappM (wrapLocM renameSig) (filter (not . isFixityLSig) sigs)
+ -- Remove fixity sigs which have been dealt with already
+
+renameSig :: Sig RdrName -> RnM (Sig Name)
+-- FixitSig is renamed elsewhere.
+renameSig (Sig v ty)
+ = lookupLocatedSigOccRn v `thenM` \ new_v ->
+ rnHsSigType (quotes (ppr v)) ty `thenM` \ new_ty ->
+ returnM (Sig new_v new_ty)
+
+renameSig (SpecInstSig ty)
+ = rnLHsType (text "A SPECIALISE instance pragma") ty `thenM` \ new_ty ->
+ returnM (SpecInstSig new_ty)
+
+renameSig (SpecSig v ty)
+ = lookupLocatedSigOccRn v `thenM` \ new_v ->
+ rnHsSigType (quotes (ppr v)) ty `thenM` \ new_ty ->
+ returnM (SpecSig new_v new_ty)
+
+renameSig (InlineSig b v p)
+ = lookupLocatedSigOccRn v `thenM` \ new_v ->
+ returnM (InlineSig b new_v p)