Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data NonEmptySet a
- singleton :: a -> NonEmptySet a
- member :: Ord a => a -> NonEmptySet a -> Bool
- toSet :: Ord a => NonEmptySet a -> Set a
- fromSet :: Set a -> Maybe (NonEmptySet a)
- toNonEmpty :: NonEmptySet a -> NonEmpty a
- fromNonEmpty :: Ord a => NonEmpty a -> NonEmptySet a
Documentation
data NonEmptySet a Source #
A non-empty set.
Instances
singleton :: a -> NonEmptySet a Source #
Create a non-empty set with a single element.
toNonEmpty :: NonEmptySet a -> NonEmpty a Source #
Convert a non-empty set to a non-empty list.
fromNonEmpty :: Ord a => NonEmpty a -> NonEmptySet a Source #
Create a non-empty set from a non-empty list.