Consider this code:
isLeaf :: Context a b -> Bool
isLeaf (_, _, _, [ ]) = True
isLeaf (_, _, _, _ ) = False
tearLeaves = let p x = if isLeaf x then Nothing else Just x in gfiltermap p
Example:
λ dag3
mkGraph [(1,'a'),(2,'b'),(3,'c')] [(1,3,())]
λ tearLeaves dag3
mkGraph [(1,'a')] [(1,3,())]
As you see, we obtain a hanging edge.
I propose gfiltermap is improved so that validity of graphs is preserved.
Consider this code:
Example:
As you see, we obtain a hanging edge.
I propose
gfiltermapis improved so that validity of graphs is preserved.