Cabal-2.0.1.0: A framework for packaging Haskell software

Safe HaskellNone
LanguageHaskell2010

Distribution.Utils.NubList

Synopsis

Documentation

data NubList a Source #

NubList : A de-duplicated list that maintains the original order.

Instances

Eq a => Eq (NubList a) Source # 

Methods

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

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

(Ord a, Read a) => Read (NubList a) Source # 
Show a => Show (NubList a) Source # 

Methods

showsPrec :: Int -> NubList a -> ShowS #

show :: NubList a -> String #

showList :: [NubList a] -> ShowS #

Ord a => Semigroup (NubList a) Source # 

Methods

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

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

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

Ord a => Monoid (NubList a) Source #

Monoid operations on NubLists. For a valid Monoid instance we need to satistfy the required monoid laws; identity, associativity and closure.

Identity : by inspection: mempty mappend NubList xs == NubList xs mappend mempty

Associativity : by inspection: (NubList xs mappend NubList ys) mappend NubList zs == NubList xs mappend (NubList ys mappend NubList zs)

Closure : appending two lists of type a and removing duplicates obviously does not change the type.

Methods

mempty :: NubList a #

mappend :: NubList a -> NubList a -> NubList a #

mconcat :: [NubList a] -> NubList a #

(Ord a, Binary a) => Binary (NubList a) Source #

Binary instance for 'NubList a' is the same as for '[a]'. For put, we just pull off constructor and put the list. For get, we get the list and make a NubList out of it using toNubList.

Methods

put :: NubList a -> Put #

get :: Get (NubList a) #

putList :: [NubList a] -> Put #

toNubList :: Ord a => [a] -> NubList a Source #

Smart constructor for the NubList type.

overNubList :: Ord a => ([a] -> [a]) -> NubList a -> NubList a Source #

Lift a function over lists to a function over NubLists.

data NubListR a Source #

NubListR : A right-biased version of NubList. That is toNubListR ["-XNoFoo", "-XFoo", "-XNoFoo"] will result in ["-XFoo", "-XNoFoo"], unlike the normal NubList, which is left-biased. Built on top of ordNubRight and listUnionRight.

Instances

Eq a => Eq (NubListR a) Source # 

Methods

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

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

(Ord a, Read a) => Read (NubListR a) Source # 
Show a => Show (NubListR a) Source # 

Methods

showsPrec :: Int -> NubListR a -> ShowS #

show :: NubListR a -> String #

showList :: [NubListR a] -> ShowS #

Ord a => Semigroup (NubListR a) Source # 

Methods

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

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

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

Ord a => Monoid (NubListR a) Source # 

Methods

mempty :: NubListR a #

mappend :: NubListR a -> NubListR a -> NubListR a #

mconcat :: [NubListR a] -> NubListR a #

toNubListR :: Ord a => [a] -> NubListR a Source #

Smart constructor for the NubListR type.

overNubListR :: Ord a => ([a] -> [a]) -> NubListR a -> NubListR a Source #

Lift a function over lists to a function over NubListRs.