Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Provides the UniqueSeq
type.
Synopsis
- data UniqueSeq a where
- pattern MkUniqueSeq :: Seq a -> HashSet a -> UniqueSeq a
- empty :: UniqueSeq a
- singleton :: Hashable a => a -> UniqueSeq a
- fromFoldable :: (Foldable f, Hashable a) => f a -> UniqueSeq a
- fromSet :: HashSet a -> UniqueSeq a
- member :: Hashable a => a -> UniqueSeq a -> Bool
- (∈) :: Hashable a => a -> UniqueSeq a -> Bool
- (∉) :: Hashable a => a -> UniqueSeq a -> Bool
- prepend :: Hashable a => a -> UniqueSeq a -> UniqueSeq a
- append :: Hashable a => UniqueSeq a -> a -> UniqueSeq a
- union :: forall a. Hashable a => UniqueSeq a -> UniqueSeq a -> UniqueSeq a
- (∪) :: Hashable a => UniqueSeq a -> UniqueSeq a -> UniqueSeq a
- (⋃) :: (Foldable f, Hashable a) => f (UniqueSeq a) -> UniqueSeq a
- map :: Hashable b => (a -> b) -> UniqueSeq a -> UniqueSeq b
- (↤) :: Hashable b => (a -> b) -> UniqueSeq a -> UniqueSeq b
- (↦) :: Hashable b => UniqueSeq a -> (a -> b) -> UniqueSeq b
- displayShow :: Show a => UniqueSeq a -> Text
- display :: (a -> Text) -> UniqueSeq a -> Text
Documentation
data UniqueSeq a where Source #
Like Seq
but with the guarantee that all elements are unique. This
comes with the cost of O(2n) space.
pattern MkUniqueSeq :: Seq a -> HashSet a -> UniqueSeq a |
Instances
Creation
Lookup
(∈) :: Hashable a => a -> UniqueSeq a -> Bool infix 4 Source #
Operator alias for member
. U+2216.
Since: 0.1
Operations
(∪) :: Hashable a => UniqueSeq a -> UniqueSeq a -> UniqueSeq a infixl 6 Source #
Operator alias for union
. U+222A.
Since: 0.1
(⋃) :: (Foldable f, Hashable a) => f (UniqueSeq a) -> UniqueSeq a Source #
Fold over union
. U+22C3.
Since: 0.1
(↤) :: Hashable b => (a -> b) -> UniqueSeq a -> UniqueSeq b infix 3 Source #
Operator alias for map
. U+21A4.
Since: 0.1
(↦) :: Hashable b => UniqueSeq a -> (a -> b) -> UniqueSeq b infix 3 Source #
Flipped (↤)
. U+21A6.
Since: 0.1