Visitar URL original
NonEmptySet.delete doesn't delete element · Issue #12570 · haskell/cabal · GitHub
Skip to content

NonEmptySet.delete doesn't delete element #12570

Open

Description

@philderbeast

There's an error in the implementation of NonEmptySet.delete, it behaves like id when the element is in the set.

delete :: Ord a => a -> NonEmptySet a -> Maybe (NonEmptySet a)
delete x (NES xs)
| Set.null res = Nothing
| otherwise = Just (NES xs)
where
res = Set.delete x xs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions