Skip to content

gfiltermap can result in inconsistent graph. #93

@kindaro

Description

@kindaro

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions