Copyright | © 2018-2020 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Provides a strict implementation of a non-empty set.
Synopsis
- data NonEmptySet a
- fromList :: Ord a => NonEmpty a -> NonEmptySet a
- fromSet :: Set a -> Maybe ( NonEmptySet a)
- singleton :: Ord a => a -> NonEmptySet a
- toList :: NonEmptySet a -> NonEmpty a
- toSet :: Ord a => NonEmptySet a -> Set a
- insert :: Ord a => a -> NonEmptySet a -> NonEmptySet a
- delete :: Ord a => a -> NonEmptySet a -> Maybe ( NonEmptySet a)
- member :: Ord a => a -> NonEmptySet a -> Bool
- union :: Ord a => NonEmptySet a -> NonEmptySet a -> NonEmptySet a
Type
data NonEmptySet a Source #
A non-empty set of elements of type
a
.
Instances
Construction
singleton :: Ord a => a -> NonEmptySet a Source #
Deconstruction
toList :: NonEmptySet a -> NonEmpty a Source #
Insertion
insert :: Ord a => a -> NonEmptySet a -> NonEmptySet a Source #
Deletion
delete :: Ord a => a -> NonEmptySet a -> Maybe ( NonEmptySet a) Source #
Membership
Combination
union :: Ord a => NonEmptySet a -> NonEmptySet a -> NonEmptySet a Source #