Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Provides the UniqueSeqNE
type.
Synopsis
- data UniqueSeqNE a where
- pattern MkUniqueSeqNE :: NESeq a -> HashSet a -> UniqueSeqNE a
- singleton :: Hashable a => a -> UniqueSeqNE a
- fromNonEmpty :: Hashable a => NonEmpty a -> UniqueSeqNE a
- unsafefromUniqueSeq :: HasCallStack => UniqueSeq a -> UniqueSeqNE a
- toNonEmpty :: UniqueSeqNE a -> NonEmpty a
- toUniqueSeq :: UniqueSeqNE a -> UniqueSeq a
- member :: Hashable a => a -> UniqueSeqNE a -> Bool
- (∈) :: Hashable a => a -> UniqueSeqNE a -> Bool
- (∉) :: Hashable a => a -> UniqueSeqNE a -> Bool
- prepend :: Hashable a => a -> UniqueSeqNE a -> UniqueSeqNE a
- append :: Hashable a => UniqueSeqNE a -> a -> UniqueSeqNE a
- union :: forall a. Hashable a => UniqueSeqNE a -> UniqueSeqNE a -> UniqueSeqNE a
- (∪) :: Hashable a => UniqueSeqNE a -> UniqueSeqNE a -> UniqueSeqNE a
- (⋃) :: Hashable a => NonEmpty (UniqueSeqNE a) -> UniqueSeqNE a
- map :: Hashable b => (a -> b) -> UniqueSeqNE a -> UniqueSeqNE b
- (↤) :: Hashable b => (a -> b) -> UniqueSeqNE a -> UniqueSeqNE b
- (↦) :: Hashable b => UniqueSeqNE a -> (a -> b) -> UniqueSeqNE b
- displayShow :: Show a => UniqueSeqNE a -> Text
- display :: (a -> Text) -> UniqueSeqNE a -> Text
Documentation
data UniqueSeqNE a where Source #
Like UniqueSeq
except carries the invariant that it is non-empty.
pattern MkUniqueSeqNE :: NESeq a -> HashSet a -> UniqueSeqNE a |
Instances
Creation
singleton :: Hashable a => a -> UniqueSeqNE a Source #
fromNonEmpty :: Hashable a => NonEmpty a -> UniqueSeqNE a Source #
unsafefromUniqueSeq :: HasCallStack => UniqueSeq a -> UniqueSeqNE a Source #
Elimination
toNonEmpty :: UniqueSeqNE a -> NonEmpty a Source #
toUniqueSeq :: UniqueSeqNE a -> UniqueSeq a Source #
Lookup
(∈) :: Hashable a => a -> UniqueSeqNE a -> Bool infix 4 Source #
Operator alias for member
. U+2216.
Since: 0.1
Operations
prepend :: Hashable a => a -> UniqueSeqNE a -> UniqueSeqNE a Source #
append :: Hashable a => UniqueSeqNE a -> a -> UniqueSeqNE a Source #
union :: forall a. Hashable a => UniqueSeqNE a -> UniqueSeqNE a -> UniqueSeqNE a Source #
(∪) :: Hashable a => UniqueSeqNE a -> UniqueSeqNE a -> UniqueSeqNE a infixl 6 Source #
Operator alias for union
. U+222A.
Since: 0.1
(⋃) :: Hashable a => NonEmpty (UniqueSeqNE a) -> UniqueSeqNE a Source #
Fold over union
. U+22C3.
Since: 0.1
map :: Hashable b => (a -> b) -> UniqueSeqNE a -> UniqueSeqNE b Source #
(↤) :: Hashable b => (a -> b) -> UniqueSeqNE a -> UniqueSeqNE b infix 3 Source #
Operator alias for map
. U+21A4.
Since: 0.1
(↦) :: Hashable b => UniqueSeqNE a -> (a -> b) -> UniqueSeqNE b infix 3 Source #
Flipped (↤)
. U+21A6.
Since: 0.1
Display
displayShow :: Show a => UniqueSeqNE a -> Text Source #