- things' = filter wantToSee things
-
- wantToSee (AnId id) = not (isDataConId id || isDataConWrapId id)
- wantToSee _ = True
-
- thing_names = map getName things
-
- thingDecl thing@(AnId id) = ifaceTyThing thing
-
- thingDecl thing@(AClass c) =
- let rn_decl = ifaceTyThing thing in
- case rn_decl of
- ClassDecl { tcdSigs = cons } ->
- rn_decl{ tcdSigs = filter methodIsVisible cons }
- other -> other
- where
- methodIsVisible (ClassOpSig n _ _ _) = n `elem` thing_names
-
- thingDecl thing@(ATyCon t) =
- let rn_decl = ifaceTyThing thing in
- case rn_decl of
- TyData { tcdCons = DataCons cons } ->
- rn_decl{ tcdCons = DataCons (filter conIsVisible cons) }
- other -> other
- where
- conIsVisible (ConDecl n _ _ _ _) = n `elem` thing_names
-