-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Anything that associates -- -- In mathematics, a semigroup is an algebraic structure consisting of a -- set together with an associative binary operation. A semigroup -- generalizes a monoid in that there might not exist an identity -- element. It also (originally) generalized a group (a monoid with all -- inverses) to a type where every element did not have to have an -- inverse, thus the name semigroup. @package semigroups @version 0.18 -- | A NonEmpty list forms a monad as per list, but always contains at -- least one element. module Data.List.NonEmpty data NonEmpty a (:|) :: a -> [a] -> NonEmpty a -- | Map a function over a NonEmpty stream. map :: (a -> b) -> NonEmpty a -> NonEmpty b -- | 'intersperse x xs' alternates elements of the list with copies of -- x. -- --
--   intersperse 0 (1 :| [2,3]) == 1 :| [0,2,0,3]
--   
intersperse :: a -> NonEmpty a -> NonEmpty a -- | scanl is similar to foldl, but returns a stream of -- successive reduced values from the left: -- --
--   scanl f z [x1, x2, ...] == z :| [z `f` x1, (z `f` x1) `f` x2, ...]
--   
-- -- Note that -- --
--   last (scanl f z xs) == foldl f z xs.
--   
scanl :: Foldable f => (b -> a -> b) -> b -> f a -> NonEmpty b -- | scanr is the right-to-left dual of scanl. Note that -- --
--   head (scanr f z xs) == foldr f z xs.
--   
scanr :: Foldable f => (a -> b -> b) -> b -> f a -> NonEmpty b -- | scanl1 is a variant of scanl that has no starting value -- argument: -- --
--   scanl1 f [x1, x2, ...] == x1 :| [x1 `f` x2, x1 `f` (x2 `f` x3), ...]
--   
scanl1 :: (a -> a -> a) -> NonEmpty a -> NonEmpty a -- | scanr1 is a variant of scanr that has no starting value -- argument. scanr1 :: (a -> a -> a) -> NonEmpty a -> NonEmpty a -- | transpose for NonEmpty, behaves the same as -- transpose The rows/columns need not be the same length, in -- which case > transpose . transpose /= id transpose :: NonEmpty (NonEmpty a) -> NonEmpty (NonEmpty a) -- | sortBy for NonEmpty, behaves the same as sortBy sortBy :: (a -> a -> Ordering) -> NonEmpty a -> NonEmpty a -- | sortWith for NonEmpty, behaves the same as: -- --
--   sortBy . comparing
--   
sortWith :: Ord o => (a -> o) -> NonEmpty a -> NonEmpty a length :: NonEmpty a -> Int -- | Extract the first element of the stream. head :: NonEmpty a -> a -- | Extract the possibly-empty tail of the stream. tail :: NonEmpty a -> [a] -- | Extract the last element of the stream. last :: NonEmpty a -> a -- | Extract everything except the last element of the stream. init :: NonEmpty a -> [a] -- | Prepend an element to the stream. (<|) :: a -> NonEmpty a -> NonEmpty a -- | Synonym for <|. cons :: a -> NonEmpty a -> NonEmpty a -- | uncons produces the first element of the stream, and a stream -- of the remaining elements, if any. uncons :: NonEmpty a -> (a, Maybe (NonEmpty a)) unfoldr :: (a -> (b, Maybe a)) -> a -> NonEmpty b -- | Sort a stream. sort :: Ord a => NonEmpty a -> NonEmpty a -- | reverse a finite NonEmpty stream. reverse :: NonEmpty a -> NonEmpty a -- | The inits function takes a stream xs and returns all -- the finite prefixes of xs. inits :: Foldable f => f a -> NonEmpty [a] -- | The tails function takes a stream xs and returns all -- the suffixes of xs. tails :: Foldable f => f a -> NonEmpty [a] -- | iterate f x produces the infinite sequence of repeated -- applications of f to x. -- --
--   iterate f x = x :| [f x, f (f x), ..]
--   
iterate :: (a -> a) -> a -> NonEmpty a -- | repeat x returns a constant stream, where all elements -- are equal to x. repeat :: a -> NonEmpty a -- | cycle xs returns the infinite repetition of -- xs: -- --
--   cycle [1,2,3] = 1 :| [2,3,1,2,3,...]
--   
cycle :: NonEmpty a -> NonEmpty a -- | unfold produces a new stream by repeatedly applying the -- unfolding function to the seed value to produce an element of type -- b and a new seed value. When the unfolding function returns -- Nothing instead of a new seed value, the stream ends. unfold :: (a -> (b, Maybe a)) -> a -> NonEmpty b -- | insert x xs inserts x into the last position -- in xs where it is still less than or equal to the next -- element. In particular, if the list is sorted beforehand, the result -- will also be sorted. insert :: (Foldable f, Ord a) => a -> f a -> NonEmpty a -- | some1 x sequences x one or more times. some1 :: Alternative f => f a -> f (NonEmpty a) -- | take n xs returns the first n elements of -- xs. take :: Int -> NonEmpty a -> [a] -- | drop n xs drops the first n elements off the -- front of the sequence xs. drop :: Int -> NonEmpty a -> [a] -- | splitAt n xs returns a pair consisting of the prefix -- of xs of length n and the remaining stream -- immediately following this prefix. -- --
--   'splitAt' n xs == ('take' n xs, 'drop' n xs)
--   xs == ys ++ zs where (ys, zs) = 'splitAt' n xs
--   
splitAt :: Int -> NonEmpty a -> ([a], [a]) -- | takeWhile p xs returns the longest prefix of the -- stream xs for which the predicate p holds. takeWhile :: (a -> Bool) -> NonEmpty a -> [a] -- | dropWhile p xs returns the suffix remaining after -- takeWhile p xs. dropWhile :: (a -> Bool) -> NonEmpty a -> [a] -- | span p xs returns the longest prefix of xs -- that satisfies p, together with the remainder of the stream. -- --
--   'span' p xs == ('takeWhile' p xs, 'dropWhile' p xs)
--   xs == ys ++ zs where (ys, zs) = 'span' p xs
--   
span :: (a -> Bool) -> NonEmpty a -> ([a], [a]) -- | The break p function is equivalent to span -- (not . p). break :: (a -> Bool) -> NonEmpty a -> ([a], [a]) -- | filter p xs removes any elements from xs that -- do not satisfy p. filter :: (a -> Bool) -> NonEmpty a -> [a] -- | The partition function takes a predicate p and a -- stream xs, and returns a pair of lists. The first list -- corresponds to the elements of xs for which p holds; -- the second corresponds to the elements of xs for which -- p does not hold. -- --
--   'partition' p xs = ('filter' p xs, 'filter' (not . p) xs)
--   
partition :: (a -> Bool) -> NonEmpty a -> ([a], [a]) -- | The group function takes a stream and returns a list of streams -- such that flattening the resulting list is equal to the argument. -- Moreover, each stream in the resulting list contains only equal -- elements. For example, in list notation: -- --
--   'group' $ 'cycle' "Mississippi" = "M" : "i" : "ss" : "i" : "ss" : "i" : "pp" : "i" : "M" : "i" : ...
--   
group :: (Foldable f, Eq a) => f a -> [NonEmpty a] -- | groupBy operates like group, but uses the provided -- equality predicate instead of ==. groupBy :: Foldable f => (a -> a -> Bool) -> f a -> [NonEmpty a] -- | groupWith operates like group, but uses the provided -- projection when comparing for equality groupWith :: (Foldable f, Eq b) => (a -> b) -> f a -> [NonEmpty a] -- | groupAllWith operates like groupWith, but sorts the list -- first so that each equivalence class has, at most, one list in the -- output groupAllWith :: (Ord b) => (a -> b) -> [a] -> [NonEmpty a] -- | group1 operates like group, but uses the knowledge that -- its input is non-empty to produce guaranteed non-empty output. group1 :: Eq a => NonEmpty a -> NonEmpty (NonEmpty a) -- | groupBy1 is to group1 as groupBy is to -- group. groupBy1 :: (a -> a -> Bool) -> NonEmpty a -> NonEmpty (NonEmpty a) -- | groupWith1 is to group1 as groupWith is to -- group groupWith1 :: (Eq b) => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a) -- | groupAllWith1 is to groupWith1 as groupAllWith is -- to groupWith groupAllWith1 :: (Ord b) => (a -> b) -> NonEmpty a -> NonEmpty (NonEmpty a) -- | The isPrefix function returns True if the first -- argument is a prefix of the second. isPrefixOf :: Eq a => [a] -> NonEmpty a -> Bool -- | The nub function removes duplicate elements from a list. In -- particular, it keeps only the first occurence of each element. (The -- name nub means 'essence'.) It is a special case of -- nubBy, which allows the programmer to supply their own -- inequality test. nub :: Eq a => NonEmpty a -> NonEmpty a -- | The nubBy function behaves just like nub, except it uses -- a user-supplied equality predicate instead of the overloaded == -- function. nubBy :: (a -> a -> Bool) -> NonEmpty a -> NonEmpty a -- | xs !! n returns the element of the stream xs at -- index n. Note that the head of the stream has index 0. -- -- Beware: a negative or out-of-bounds index will cause an error. (!!) :: NonEmpty a -> Int -> a -- | The zip function takes two streams and returns a stream of -- corresponding pairs. zip :: NonEmpty a -> NonEmpty b -> NonEmpty (a, b) -- | The zipWith function generalizes zip. Rather than -- tupling the elements, the elements are combined using the function -- passed as the first argument. zipWith :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c -- | The unzip function is the inverse of the zip function. unzip :: Functor f => f (a, b) -> (f a, f b) -- | Converts a normal list to a NonEmpty stream. -- -- Raises an error if given an empty list. fromList :: [a] -> NonEmpty a -- | Convert a stream to a normal list efficiently. toList :: NonEmpty a -> [a] -- | nonEmpty efficiently turns a normal list into a NonEmpty -- stream, producing Nothing if the input is empty. nonEmpty :: [a] -> Maybe (NonEmpty a) xor :: NonEmpty Bool -> Bool instance GHC.Generics.Constructor Data.List.NonEmpty.C1_0NonEmpty instance GHC.Generics.Datatype Data.List.NonEmpty.D1NonEmpty instance GHC.Generics.Generic1 Data.List.NonEmpty.NonEmpty instance GHC.Generics.Generic (Data.List.NonEmpty.NonEmpty a) instance Data.Data.Data a => Data.Data.Data (Data.List.NonEmpty.NonEmpty a) instance GHC.Read.Read a => GHC.Read.Read (Data.List.NonEmpty.NonEmpty a) instance GHC.Show.Show a => GHC.Show.Show (Data.List.NonEmpty.NonEmpty a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.List.NonEmpty.NonEmpty a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.List.NonEmpty.NonEmpty a) instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Data.List.NonEmpty.NonEmpty a) instance GHC.Exts.IsList (Data.List.NonEmpty.NonEmpty a) instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.List.NonEmpty.NonEmpty a) instance Control.Monad.Fix.MonadFix Data.List.NonEmpty.NonEmpty instance Control.Monad.Zip.MonadZip Data.List.NonEmpty.NonEmpty instance GHC.Base.Functor Data.List.NonEmpty.NonEmpty instance GHC.Base.Applicative Data.List.NonEmpty.NonEmpty instance GHC.Base.Monad Data.List.NonEmpty.NonEmpty instance Data.Traversable.Traversable Data.List.NonEmpty.NonEmpty instance Data.Foldable.Foldable Data.List.NonEmpty.NonEmpty -- | In mathematics, a semigroup is an algebraic structure consisting of a -- set together with an associative binary operation. A semigroup -- generalizes a monoid in that there might not exist an identity -- element. It also (originally) generalized a group (a monoid with all -- inverses) to a type where every element did not have to have an -- inverse, thus the name semigroup. -- -- The use of (<>) in this module conflicts with an -- operator with the same name that is being exported by Data.Monoid. -- However, this package re-exports (most of) the contents of -- Data.Monoid, so to use semigroups and monoids in the same package just -- --
--   import Data.Semigroup
--   
module Data.Semigroup class Semigroup a where (<>) = mappend sconcat (a :| as) = go a as where go b (c : cs) = b <> go c cs go b [] = b stimes y0 x0 | y0 <= 0 = error "stimes: positive multiplier expected" | otherwise = f x0 y0 where f x y | even y = f (x <> x) (y `quot` 2) | y == 1 = x | otherwise = g (x <> x) (pred y `quot` 2) x g x y z | even y = g (x <> x) (y `quot` 2) z | y == 1 = x <> z | otherwise = g (x <> x) (pred y `quot` 2) (x <> z) -- | An associative operation. -- --
--   (a <> b) <> c = a <> (b <> c)
--   
-- -- If a is also a Monoid we further require -- --
--   (<>) = mappend
--   
(<>) :: Semigroup a => a -> a -> a -- | Reduce a non-empty list with <> -- -- The default definition should be sufficient, but this can be -- overridden for efficiency. sconcat :: Semigroup a => NonEmpty a -> a -- | Repeat a value n times. -- -- Given that this works on a Semigroup it is allowed to fail if -- you request 0 or fewer repetitions, and the default definition will do -- so. -- -- By making this a member of the class, idempotent semigroups and -- monoids can upgrade this to execute in O(1) by picking -- stimes = stimesIdempotent or stimes = -- stimesIdempotentMonoid respectively. stimes :: (Semigroup a, Integral b) => b -> a -> a -- | This is a valid definition of stimes for a Monoid. -- -- Unlike the default definition of stimes, it is defined for 0 -- and so it should be preferred where possible. stimesMonoid :: (Integral b, Monoid a) => b -> a -> a -- | This is a valid definition of stimes for an idempotent -- Semigroup. -- -- When x <> x = x, this definition should be preferred, -- because it works in O(1) rather than O(log n). stimesIdempotent :: Integral b => b -> a -> a -- | This is a valid definition of stimes for an idempotent -- Monoid. -- -- When mappend x x = x, this definition should be preferred, -- because it works in O(1) rather than O(log n) stimesIdempotentMonoid :: (Integral b, Monoid a) => b -> a -> a -- | Repeat a value n times. -- --
--   mtimesDefault n a = a <> a <> ... <> a  -- using <> (n-1) times
--   
-- -- Implemented using stimes and mempty. -- -- This is a suitable definition for an mtimes member of -- Monoid. mtimesDefault :: (Integral b, Monoid a) => b -> a -> a newtype Min a Min :: a -> Min a [getMin] :: Min a -> a newtype Max a Max :: a -> Max a [getMax] :: Max a -> a -- | Use Option (First a) to get the behavior of -- First from Data.Monoid. newtype First a First :: a -> First a [getFirst] :: First a -> a -- | Use Option (Last a) to get the behavior of -- Last from Data.Monoid newtype Last a Last :: a -> Last a [getLast] :: Last a -> a -- | Provide a Semigroup for an arbitrary Monoid. newtype WrappedMonoid m WrapMonoid :: m -> WrappedMonoid m [unwrapMonoid] :: WrappedMonoid m -> m -- | The class of monoids (types with an associative binary operation that -- has an identity). Instances should satisfy the following laws: -- -- -- -- The method names refer to the monoid of lists under concatenation, but -- there are many other instances. -- -- Some types can be viewed as a monoid in more than one way, e.g. both -- addition and multiplication on numbers. In such cases we often define -- newtypes and make those instances of Monoid, e.g. -- Sum and Product. class Monoid a -- | Identity of mappend mempty :: Monoid a => a -- | An associative operation mappend :: Monoid a => a -> a -> a -- | Fold a list using the monoid. For most types, the default definition -- for mconcat will be used, but the function is included in the -- class definition so that an optimized version can be provided for -- specific types. mconcat :: Monoid a => [a] -> a -- | The dual of a Monoid, obtained by swapping the arguments of -- mappend. newtype Dual a :: * -> * Dual :: a -> Dual a [getDual] :: Dual a -> a -- | The monoid of endomorphisms under composition. newtype Endo a :: * -> * Endo :: (a -> a) -> Endo a [appEndo] :: Endo a -> a -> a -- | Boolean monoid under conjunction (&&). newtype All :: * All :: Bool -> All [getAll] :: All -> Bool -- | Boolean monoid under disjunction (||). newtype Any :: * Any :: Bool -> Any [getAny] :: Any -> Bool -- | Monoid under addition. newtype Sum a :: * -> * Sum :: a -> Sum a [getSum] :: Sum a -> a -- | Monoid under multiplication. newtype Product a :: * -> * Product :: a -> Product a [getProduct] :: Product a -> a -- | Option is effectively Maybe with a better instance of -- Monoid, built off of an underlying Semigroup instead of -- an underlying Monoid. -- -- Ideally, this type would not exist at all and we would just fix the -- Monoid instance of Maybe newtype Option a Option :: Maybe a -> Option a [getOption] :: Option a -> Maybe a -- | Fold an Option case-wise, just like maybe. option :: b -> (a -> b) -> Option a -> b -- | This lets you use a difference list of a Semigroup as a -- Monoid. diff :: Semigroup m => m -> Endo m -- | A generalization of cycle to an arbitrary Semigroup. May -- fail to terminate for some values in some semigroups. cycle1 :: Semigroup m => m -> m -- | Arg isn't itself a Semigroup in its own right, but it -- can be placed inside Min and Max to compute an arg min -- or arg max. data Arg a b Arg :: a -> b -> Arg a b type ArgMin a b = Min (Arg a b) type ArgMax a b = Max (Arg a b) instance GHC.Generics.Selector Data.Semigroup.S1_0_0Option instance GHC.Generics.Constructor Data.Semigroup.C1_0Option instance GHC.Generics.Datatype Data.Semigroup.D1Option instance GHC.Generics.Selector Data.Semigroup.S1_0_0WrappedMonoid instance GHC.Generics.Constructor Data.Semigroup.C1_0WrappedMonoid instance GHC.Generics.Datatype Data.Semigroup.D1WrappedMonoid instance GHC.Generics.Selector Data.Semigroup.S1_0_0Last instance GHC.Generics.Constructor Data.Semigroup.C1_0Last instance GHC.Generics.Datatype Data.Semigroup.D1Last instance GHC.Generics.Selector Data.Semigroup.S1_0_0First instance GHC.Generics.Constructor Data.Semigroup.C1_0First instance GHC.Generics.Datatype Data.Semigroup.D1First instance GHC.Generics.Constructor Data.Semigroup.C1_0Arg instance GHC.Generics.Datatype Data.Semigroup.D1Arg instance GHC.Generics.Selector Data.Semigroup.S1_0_0Max instance GHC.Generics.Constructor Data.Semigroup.C1_0Max instance GHC.Generics.Datatype Data.Semigroup.D1Max instance GHC.Generics.Selector Data.Semigroup.S1_0_0Min instance GHC.Generics.Constructor Data.Semigroup.C1_0Min instance GHC.Generics.Datatype Data.Semigroup.D1Min instance GHC.Generics.Generic1 Data.Semigroup.Option instance GHC.Generics.Generic (Data.Semigroup.Option a) instance Data.Data.Data a => Data.Data.Data (Data.Semigroup.Option a) instance GHC.Read.Read a => GHC.Read.Read (Data.Semigroup.Option a) instance GHC.Show.Show a => GHC.Show.Show (Data.Semigroup.Option a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Semigroup.Option a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Semigroup.Option a) instance GHC.Generics.Generic1 Data.Semigroup.WrappedMonoid instance GHC.Generics.Generic (Data.Semigroup.WrappedMonoid m) instance Data.Data.Data m => Data.Data.Data (Data.Semigroup.WrappedMonoid m) instance GHC.Read.Read m => GHC.Read.Read (Data.Semigroup.WrappedMonoid m) instance GHC.Show.Show m => GHC.Show.Show (Data.Semigroup.WrappedMonoid m) instance GHC.Classes.Ord m => GHC.Classes.Ord (Data.Semigroup.WrappedMonoid m) instance GHC.Classes.Eq m => GHC.Classes.Eq (Data.Semigroup.WrappedMonoid m) instance GHC.Generics.Generic1 Data.Semigroup.Last instance GHC.Generics.Generic (Data.Semigroup.Last a) instance Data.Data.Data a => Data.Data.Data (Data.Semigroup.Last a) instance GHC.Read.Read a => GHC.Read.Read (Data.Semigroup.Last a) instance GHC.Show.Show a => GHC.Show.Show (Data.Semigroup.Last a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Semigroup.Last a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Semigroup.Last a) instance GHC.Generics.Generic1 Data.Semigroup.First instance GHC.Generics.Generic (Data.Semigroup.First a) instance Data.Data.Data a => Data.Data.Data (Data.Semigroup.First a) instance GHC.Read.Read a => GHC.Read.Read (Data.Semigroup.First a) instance GHC.Show.Show a => GHC.Show.Show (Data.Semigroup.First a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Semigroup.First a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Semigroup.First a) instance GHC.Generics.Generic1 (Data.Semigroup.Arg a) instance GHC.Generics.Generic (Data.Semigroup.Arg a b) instance (Data.Data.Data a, Data.Data.Data b) => Data.Data.Data (Data.Semigroup.Arg a b) instance (GHC.Read.Read a, GHC.Read.Read b) => GHC.Read.Read (Data.Semigroup.Arg a b) instance (GHC.Show.Show a, GHC.Show.Show b) => GHC.Show.Show (Data.Semigroup.Arg a b) instance GHC.Generics.Generic1 Data.Semigroup.Max instance GHC.Generics.Generic (Data.Semigroup.Max a) instance Data.Data.Data a => Data.Data.Data (Data.Semigroup.Max a) instance GHC.Read.Read a => GHC.Read.Read (Data.Semigroup.Max a) instance GHC.Show.Show a => GHC.Show.Show (Data.Semigroup.Max a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Semigroup.Max a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Semigroup.Max a) instance GHC.Generics.Generic1 Data.Semigroup.Min instance GHC.Generics.Generic (Data.Semigroup.Min a) instance Data.Data.Data a => Data.Data.Data (Data.Semigroup.Min a) instance GHC.Read.Read a => GHC.Read.Read (Data.Semigroup.Min a) instance GHC.Show.Show a => GHC.Show.Show (Data.Semigroup.Min a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Semigroup.Min a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Semigroup.Min a) instance Data.Semigroup.Semigroup () instance Data.Semigroup.Semigroup b => Data.Semigroup.Semigroup (a -> b) instance Data.Semigroup.Semigroup [a] instance Data.Semigroup.Semigroup a => Data.Semigroup.Semigroup (GHC.Base.Maybe a) instance Data.Semigroup.Semigroup (Data.Either.Either a b) instance (Data.Semigroup.Semigroup a, Data.Semigroup.Semigroup b) => Data.Semigroup.Semigroup (a, b) instance (Data.Semigroup.Semigroup a, Data.Semigroup.Semigroup b, Data.Semigroup.Semigroup c) => Data.Semigroup.Semigroup (a, b, c) instance (Data.Semigroup.Semigroup a, Data.Semigroup.Semigroup b, Data.Semigroup.Semigroup c, Data.Semigroup.Semigroup d) => Data.Semigroup.Semigroup (a, b, c, d) instance (Data.Semigroup.Semigroup a, Data.Semigroup.Semigroup b, Data.Semigroup.Semigroup c, Data.Semigroup.Semigroup d, Data.Semigroup.Semigroup e) => Data.Semigroup.Semigroup (a, b, c, d, e) instance Data.Semigroup.Semigroup GHC.Types.Ordering instance Data.Semigroup.Semigroup a => Data.Semigroup.Semigroup (Data.Monoid.Dual a) instance Data.Semigroup.Semigroup (Data.Monoid.Endo a) instance Data.Semigroup.Semigroup Data.Monoid.All instance Data.Semigroup.Semigroup Data.Monoid.Any instance GHC.Num.Num a => Data.Semigroup.Semigroup (Data.Monoid.Sum a) instance GHC.Num.Num a => Data.Semigroup.Semigroup (Data.Monoid.Product a) instance Data.Semigroup.Semigroup a => Data.Semigroup.Semigroup (Control.Applicative.Const a b) instance Data.Semigroup.Semigroup (Data.Monoid.First a) instance Data.Semigroup.Semigroup (Data.Monoid.Last a) instance GHC.Base.Alternative f => Data.Semigroup.Semigroup (Data.Monoid.Alt f a) instance Data.Semigroup.Semigroup Data.Void.Void instance Data.Semigroup.Semigroup (Data.List.NonEmpty.NonEmpty a) instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Data.Semigroup.Min a) instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Semigroup.Min a) instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Data.Semigroup.Min a) instance GHC.Classes.Ord a => Data.Semigroup.Semigroup (Data.Semigroup.Min a) instance (GHC.Classes.Ord a, GHC.Enum.Bounded a) => GHC.Base.Monoid (Data.Semigroup.Min a) instance GHC.Base.Functor Data.Semigroup.Min instance Data.Foldable.Foldable Data.Semigroup.Min instance Data.Traversable.Traversable Data.Semigroup.Min instance GHC.Base.Applicative Data.Semigroup.Min instance GHC.Base.Monad Data.Semigroup.Min instance Control.Monad.Fix.MonadFix Data.Semigroup.Min instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Semigroup.Min a) instance GHC.Num.Num a => GHC.Num.Num (Data.Semigroup.Min a) instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Data.Semigroup.Max a) instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Semigroup.Max a) instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Data.Semigroup.Max a) instance GHC.Classes.Ord a => Data.Semigroup.Semigroup (Data.Semigroup.Max a) instance (GHC.Classes.Ord a, GHC.Enum.Bounded a) => GHC.Base.Monoid (Data.Semigroup.Max a) instance GHC.Base.Functor Data.Semigroup.Max instance Data.Foldable.Foldable Data.Semigroup.Max instance Data.Traversable.Traversable Data.Semigroup.Max instance GHC.Base.Applicative Data.Semigroup.Max instance GHC.Base.Monad Data.Semigroup.Max instance Control.Monad.Fix.MonadFix Data.Semigroup.Max instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Semigroup.Max a) instance GHC.Num.Num a => GHC.Num.Num (Data.Semigroup.Max a) instance GHC.Base.Functor (Data.Semigroup.Arg a) instance Data.Foldable.Foldable (Data.Semigroup.Arg a) instance Data.Traversable.Traversable (Data.Semigroup.Arg a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Data.Semigroup.Arg a b) instance GHC.Classes.Ord a => GHC.Classes.Ord (Data.Semigroup.Arg a b) instance (Control.DeepSeq.NFData a, Control.DeepSeq.NFData b) => Control.DeepSeq.NFData (Data.Semigroup.Arg a b) instance (Data.Hashable.Class.Hashable a, Data.Hashable.Class.Hashable b) => Data.Hashable.Class.Hashable (Data.Semigroup.Arg a b) instance Data.Bifunctor.Bifunctor Data.Semigroup.Arg instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Data.Semigroup.First a) instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Semigroup.First a) instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Data.Semigroup.First a) instance Data.Semigroup.Semigroup (Data.Semigroup.First a) instance GHC.Base.Functor Data.Semigroup.First instance Data.Foldable.Foldable Data.Semigroup.First instance Data.Traversable.Traversable Data.Semigroup.First instance GHC.Base.Applicative Data.Semigroup.First instance GHC.Base.Monad Data.Semigroup.First instance Control.Monad.Fix.MonadFix Data.Semigroup.First instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Semigroup.First a) instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Data.Semigroup.Last a) instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Semigroup.Last a) instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Data.Semigroup.Last a) instance Data.Semigroup.Semigroup (Data.Semigroup.Last a) instance GHC.Base.Functor Data.Semigroup.Last instance Data.Foldable.Foldable Data.Semigroup.Last instance Data.Traversable.Traversable Data.Semigroup.Last instance GHC.Base.Applicative Data.Semigroup.Last instance GHC.Base.Monad Data.Semigroup.Last instance Control.Monad.Fix.MonadFix Data.Semigroup.Last instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Semigroup.Last a) instance Data.Semigroup.Semigroup Data.ByteString.Internal.ByteString instance Data.Semigroup.Semigroup Data.ByteString.Lazy.Internal.ByteString instance Data.Semigroup.Semigroup Data.ByteString.Builder.Internal.Builder instance Data.Semigroup.Semigroup Data.ByteString.Short.Internal.ShortByteString instance Data.Semigroup.Semigroup Data.Text.Internal.Text instance Data.Semigroup.Semigroup Data.Text.Internal.Lazy.Text instance Data.Semigroup.Semigroup Data.Text.Internal.Builder.Builder instance (Data.Hashable.Class.Hashable k, GHC.Classes.Eq k) => Data.Semigroup.Semigroup (Data.HashMap.Base.HashMap k a) instance (Data.Hashable.Class.Hashable a, GHC.Classes.Eq a) => Data.Semigroup.Semigroup (Data.HashSet.HashSet a) instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Data.Semigroup.WrappedMonoid a) instance GHC.Base.Monoid m => Data.Semigroup.Semigroup (Data.Semigroup.WrappedMonoid m) instance GHC.Base.Monoid m => GHC.Base.Monoid (Data.Semigroup.WrappedMonoid m) instance GHC.Enum.Bounded a => GHC.Enum.Bounded (Data.Semigroup.WrappedMonoid a) instance GHC.Enum.Enum a => GHC.Enum.Enum (Data.Semigroup.WrappedMonoid a) instance Control.DeepSeq.NFData m => Control.DeepSeq.NFData (Data.Semigroup.WrappedMonoid m) instance Data.Hashable.Class.Hashable a => Data.Hashable.Class.Hashable (Data.Semigroup.Option a) instance GHC.Base.Functor Data.Semigroup.Option instance GHC.Base.Applicative Data.Semigroup.Option instance GHC.Base.Monad Data.Semigroup.Option instance GHC.Base.Alternative Data.Semigroup.Option instance GHC.Base.MonadPlus Data.Semigroup.Option instance Control.Monad.Fix.MonadFix Data.Semigroup.Option instance Data.Foldable.Foldable Data.Semigroup.Option instance Data.Traversable.Traversable Data.Semigroup.Option instance Control.DeepSeq.NFData a => Control.DeepSeq.NFData (Data.Semigroup.Option a) instance Data.Semigroup.Semigroup a => Data.Semigroup.Semigroup (Data.Semigroup.Option a) instance Data.Semigroup.Semigroup a => GHC.Base.Monoid (Data.Semigroup.Option a) instance Data.Semigroup.Semigroup (Data.Sequence.Seq a) instance Data.Semigroup.Semigroup Data.IntSet.Base.IntSet instance GHC.Classes.Ord a => Data.Semigroup.Semigroup (Data.Set.Base.Set a) instance Data.Semigroup.Semigroup (Data.IntMap.Base.IntMap v) instance GHC.Classes.Ord k => Data.Semigroup.Semigroup (Data.Map.Base.Map k v) instance forall (k :: BOX) (s :: k). Data.Semigroup.Semigroup (Data.Proxy.Proxy s) instance forall (k :: BOX) (s :: k) a. Data.Semigroup.Semigroup a => Data.Semigroup.Semigroup (Data.Tagged.Tagged s a) -- | This module provides generic deriving tools for monoids and semigroups -- for product-like structures. module Data.Semigroup.Generic class GSemigroup f -- | Generically generate a Semigroup (<>) operation -- for any type implementing Generic. This operation will append -- two values by point-wise appending their component fields. It is only -- defined for product types. -- --
--   gmappend a (gmappend b c) = gmappend (gmappend a b) c
--   
gmappend :: (Generic a, GSemigroup (Rep a)) => a -> a -> a class GSemigroup f => GMonoid f -- | Generically generate a Monoid mempty for any -- product-like type implementing Generic. -- -- It is only defined for product types. -- --
--   gmappend gmempty a = a = gmappend a gmempty
--   
gmempty :: (Generic a, GMonoid (Rep a)) => a instance Data.Semigroup.Generic.GSemigroup GHC.Generics.U1 instance Data.Semigroup.Generic.GSemigroup GHC.Generics.V1 instance Data.Semigroup.Semigroup a => Data.Semigroup.Generic.GSemigroup (GHC.Generics.K1 i a) instance Data.Semigroup.Generic.GSemigroup f => Data.Semigroup.Generic.GSemigroup (GHC.Generics.M1 i c f) instance (Data.Semigroup.Generic.GSemigroup f, Data.Semigroup.Generic.GSemigroup g) => Data.Semigroup.Generic.GSemigroup (f GHC.Generics.:*: g) instance Data.Semigroup.Generic.GMonoid GHC.Generics.U1 instance (Data.Semigroup.Semigroup a, GHC.Base.Monoid a) => Data.Semigroup.Generic.GMonoid (GHC.Generics.K1 i a) instance Data.Semigroup.Generic.GMonoid f => Data.Semigroup.Generic.GMonoid (GHC.Generics.M1 i c f) instance (Data.Semigroup.Generic.GMonoid f, Data.Semigroup.Generic.GMonoid g) => Data.Semigroup.Generic.GMonoid (f GHC.Generics.:*: g)