charon-0.1: Template
Safe HaskellSafe-Inferred
LanguageGHC2021

Charon.Data.UniqueSeq.Internal

Description

Provides the UniqueSeq type.

Synopsis

Type

data UniqueSeq a Source #

Like Seq but with the guarantee that all elements are unique. This comes with the cost of O(2n) space.

Constructors

UnsafeUniqueSeq 

Fields

Bundled Patterns

pattern MkUniqueSeq :: Seq a -> HashSet a -> UniqueSeq a 

Instances

Instances details
Foldable UniqueSeq Source # 
Instance details

Defined in Charon.Data.UniqueSeq.Internal

Methods

fold :: Monoid m => UniqueSeq m -> m #

foldMap :: Monoid m => (a -> m) -> UniqueSeq a -> m #

foldMap' :: Monoid m => (a -> m) -> UniqueSeq a -> m #

foldr :: (a -> b -> b) -> b -> UniqueSeq a -> b #

foldr' :: (a -> b -> b) -> b -> UniqueSeq a -> b #

foldl :: (b -> a -> b) -> b -> UniqueSeq a -> b #

foldl' :: (b -> a -> b) -> b -> UniqueSeq a -> b #

foldr1 :: (a -> a -> a) -> UniqueSeq a -> a #

foldl1 :: (a -> a -> a) -> UniqueSeq a -> a #

toList :: UniqueSeq a -> [a] #

null :: UniqueSeq a -> Bool #

length :: UniqueSeq a -> Int #

elem :: Eq a => a -> UniqueSeq a -> Bool #

maximum :: Ord a => UniqueSeq a -> a #

minimum :: Ord a => UniqueSeq a -> a #

sum :: Num a => UniqueSeq a -> a #

product :: Num a => UniqueSeq a -> a #

(k ~ A_Getter, b ~ Seq a, c ~ Seq a) => LabelOptic "seq" k (UniqueSeq a) (UniqueSeq a) b c Source # 
Instance details

Defined in Charon.Data.UniqueSeq.Internal

Methods

labelOptic :: Optic k NoIx (UniqueSeq a) (UniqueSeq a) b c Source #

(k ~ A_Getter, b ~ HashSet a, c ~ HashSet a) => LabelOptic "set" k (UniqueSeq a) (UniqueSeq a) b c Source # 
Instance details

Defined in Charon.Data.UniqueSeq.Internal

Methods

labelOptic :: Optic k NoIx (UniqueSeq a) (UniqueSeq a) b c Source #

Hashable a => Monoid (UniqueSeq a) Source # 
Instance details

Defined in Charon.Data.UniqueSeq.Internal

Hashable a => Semigroup (UniqueSeq a) Source # 
Instance details

Defined in Charon.Data.UniqueSeq.Internal

Methods

(<>) :: UniqueSeq a -> UniqueSeq a -> UniqueSeq a #

sconcat :: NonEmpty (UniqueSeq a) -> UniqueSeq a #

stimes :: Integral b => b -> UniqueSeq a -> UniqueSeq a #

Hashable a => IsList (UniqueSeq a) Source # 
Instance details

Defined in Charon.Data.UniqueSeq.Internal

Associated Types

type Item (UniqueSeq a) #

Methods

fromList :: [Item (UniqueSeq a)] -> UniqueSeq a #

fromListN :: Int -> [Item (UniqueSeq a)] -> UniqueSeq a #

toList :: UniqueSeq a -> [Item (UniqueSeq a)] #

Show a => Show (UniqueSeq a) Source # 
Instance details

Defined in Charon.Data.UniqueSeq.Internal

Eq a => Eq (UniqueSeq a) Source # 
Instance details

Defined in Charon.Data.UniqueSeq.Internal

Methods

(==) :: UniqueSeq a -> UniqueSeq a -> Bool #

(/=) :: UniqueSeq a -> UniqueSeq a -> Bool #

type Item (UniqueSeq a) Source # 
Instance details

Defined in Charon.Data.UniqueSeq.Internal

type Item (UniqueSeq a) = a

Creation

Operations

union :: forall a. Hashable a => UniqueSeq a -> UniqueSeq a -> UniqueSeq a Source #

Utils

insertSeq :: Hashable a => (a -> Seq a -> Seq a) -> a -> UniqueSeq a -> UniqueSeq a Source #