Skip to content

Commit ee682b3

Browse files
authored
Merge pull request #4 from lortabac/master
Added filterDestructorsFor function
2 parents f25fc7b + a01b2b9 commit ee682b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Documentator/Descriptors.hs

+5
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,8 @@ argumentsTyCon t@(TyWildCard _ _) = [t]
7878
isTyFun :: Located Type -> Bool
7979
isTyFun (TyFun _ _ _) = True
8080
isTyFun _ = False
81+
82+
filterDestructorsFor :: [Located Decl] -> Type () -> [Located Decl]
83+
filterDestructorsFor decls ty = filter hasTyArgument decls where
84+
hasTyArgument (TypeSig _ _ sigType) = ty `elem` map (fmap (const ())) (argumentsTyCon sigType)
85+
hasTyArgument _ = False

0 commit comments

Comments
 (0)