Distribution.Utils.NubList

Cabal-3.2.0.0: A framework for packaging Haskell software

Safe Haskell | None
Language | Haskell2010

Distribution.Utils.NubList

Synopsis

- data NubList a
- toNubList :: Ord a => [a] -> NubList a
- fromNubList :: NubList a -> [a]
- overNubList :: Ord a => ([a] -> [a]) -> NubList a -> NubList a
- data NubListR a
- toNubListR :: Ord a => [a] -> NubListR a
- fromNubListR :: NubListR a -> [a]
- overNubListR :: Ord a => ([a] -> [a]) -> NubListR a -> NubListR a

# Documentation

data NubList a #

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

#### Instances

Instances details

Eq a => Eq (NubList a) # |
Instance details Defined in Distribution.Utils.NubList Methods (==) :: NubList a -> NubList a -> Bool # (/=) :: NubList a -> NubList a -> Bool #
(Ord a, Read a) => Read (NubList a) # |
Instance details Defined in Distribution.Utils.NubList Methods readsPrec :: Int -> ReadS (NubList a) Source # readList :: ReadS [NubList a] Source # readPrec :: ReadPrec (NubList a) Source # readListPrec :: ReadPrec [NubList a] Source #
Show a => Show (NubList a) # |
Instance details Defined in Distribution.Utils.NubList Methods showsPrec :: Int -> NubList a -> ShowS Source # show :: NubList a -> String Source # showList :: [NubList a] -> ShowS Source #
Generic (NubList a) # |
Instance details Defined in Distribution.Utils.NubList Associated Types type Rep (NubList a) :: Type -> Type Source # Methods from :: NubList a -> Rep (NubList a) x Source # to :: Rep (NubList a) x -> NubList a Source #
Ord a => Semigroup (NubList a) # |
Instance details Defined in Distribution.Utils.NubList Methods (<>) :: NubList a -> NubList a -> NubList a Source # sconcat :: NonEmpty (NubList a) -> NubList a Source # stimes :: Integral b => b -> NubList a -> NubList a Source #
Ord a => Monoid (NubList a) # | 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.
Instance details Defined in Distribution.Utils.NubList Methods mempty :: NubList a Source # mappend :: NubList a -> NubList a -> NubList a Source # mconcat :: [NubList a] -> NubList a Source #
(Ord a, Binary a) => Binary (NubList a) # | 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`.
Instance details Defined in Distribution.Utils.NubList Methods put :: NubList a -> Put Source # get :: Get (NubList a) Source # putList :: [NubList a] -> Put Source #
Structured a => Structured (NubList a) # |
Instance details Defined in Distribution.Utils.NubList Methods structure :: Proxy (NubList a) -> Structure # structureHash' :: Tagged (NubList a) MD5
type Rep (NubList a) # |
Instance details Defined in Distribution.Utils.NubList type Rep (NubList a) = D1 ('MetaData "NubList" "Distribution.Utils.NubList" "Cabal-3.2.0.0" 'True) (C1 ('MetaCons "NubList" 'PrefixI 'True) (S1 ('MetaSel ('Just "fromNubList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])))

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

Smart constructor for the NubList type.

fromNubList :: NubList a -> [a] #

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

Lift a function over lists to a function over NubLists.

data NubListR a #

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

Instances details

Eq a => Eq (NubListR a) # |
Instance details Defined in Distribution.Utils.NubList Methods (==) :: NubListR a -> NubListR a -> Bool # (/=) :: NubListR a -> NubListR a -> Bool #
(Ord a, Read a) => Read (NubListR a) # |
Instance details Defined in Distribution.Utils.NubList Methods readsPrec :: Int -> ReadS (NubListR a) Source # readList :: ReadS [NubListR a] Source # readPrec :: ReadPrec (NubListR a) Source # readListPrec :: ReadPrec [NubListR a] Source #
Show a => Show (NubListR a) # |
Instance details Defined in Distribution.Utils.NubList Methods showsPrec :: Int -> NubListR a -> ShowS Source # show :: NubListR a -> String Source # showList :: [NubListR a] -> ShowS Source #
Ord a => Semigroup (NubListR a) # |
Instance details Defined in Distribution.Utils.NubList Methods (<>) :: NubListR a -> NubListR a -> NubListR a Source # sconcat :: NonEmpty (NubListR a) -> NubListR a Source # stimes :: Integral b => b -> NubListR a -> NubListR a Source #
Ord a => Monoid (NubListR a) # |
Instance details Defined in Distribution.Utils.NubList Methods mempty :: NubListR a Source # mappend :: NubListR a -> NubListR a -> NubListR a Source # mconcat :: [NubListR a] -> NubListR a Source #

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

Smart constructor for the NubListR type.

fromNubListR :: NubListR a -> [a] #

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

Lift a function over lists to a function over NubListRs.