base-compat-batteries-0.12.1: base-compat with extra batteries

Data.Semigroup.Compat

Synopsis

# Documentation

class Semigroup a where #

The class of semigroups (types with an associative binary operation).

Instances should satisfy the following:

Associativity
x <> (y <> z) = (x <> y) <> z

Since: base-4.9.0.0

Minimal complete definition

(<>)

Methods

(<>) :: a -> a -> a infixr 6 #

An associative operation.

>>> [1,2,3] <> [4,5,6]
[1,2,3,4,5,6]

sconcat :: NonEmpty a -> a #

Reduce a non-empty list with <>

The default definition should be sufficient, but this can be overridden for efficiency.

>>> import Data.List.NonEmpty
>>> sconcat $"Hello" :| [" ", "Haskell", "!"] "Hello Haskell!" stimes :: Integral b => b -> 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 $$\mathcal{O}(1)$$ by picking stimes = stimesIdempotent or stimes = stimesIdempotentMonoid respectively. >>> stimes 4 [1] [1,1,1,1] #### Instances Instances details  Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodsstimes :: Integral b => b -> Ordering -> Ordering # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: () -> () -> () #sconcat :: NonEmpty () -> () #stimes :: Integral b => b -> () -> () # Since: base-4.9.0.0 Instance detailsDefined in Data.Void Methods(<>) :: Void -> Void -> Void #stimes :: Integral b => b -> Void -> Void # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: All -> All -> All #stimes :: Integral b => b -> All -> All # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Any -> Any -> Any #stimes :: Integral b => b -> Any -> Any # Semigroup [a] Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: [a] -> [a] -> [a] #sconcat :: NonEmpty [a] -> [a] #stimes :: Integral b => b -> [a] -> [a] # Semigroup a => Semigroup (Maybe a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: Maybe a -> Maybe a -> Maybe a #sconcat :: NonEmpty (Maybe a) -> Maybe a #stimes :: Integral b => b -> Maybe a -> Maybe a # Semigroup a => Semigroup (IO a) Since: base-4.10.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: IO a -> IO a -> IO a #sconcat :: NonEmpty (IO a) -> IO a #stimes :: Integral b => b -> IO a -> IO a # Semigroup a => Semigroup (Solo a) Instance detailsDefined in Data.Tuple.Solo Methods(<>) :: Solo a -> Solo a -> Solo a #sconcat :: NonEmpty (Solo a) -> Solo a #stimes :: Integral b => b -> Solo a -> Solo a # Instance detailsDefined in Data.Functor.Contravariant Methods(<>) :: Predicate a -> Predicate a -> Predicate a #sconcat :: NonEmpty (Predicate a) -> Predicate a #stimes :: Integral b => b -> Predicate a -> Predicate a # Instance detailsDefined in Data.Functor.Contravariant Methods(<>) :: Comparison a -> Comparison a -> Comparison a #sconcat :: NonEmpty (Comparison a) -> Comparison a #stimes :: Integral b => b -> Comparison a -> Comparison a # Instance detailsDefined in Data.Functor.Contravariant Methods(<>) :: Equivalence a -> Equivalence a -> Equivalence a #stimes :: Integral b => b -> Equivalence a -> Equivalence a # Ord a => Semigroup (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Min a -> Min a -> Min a #sconcat :: NonEmpty (Min a) -> Min a #stimes :: Integral b => b -> Min a -> Min a # Ord a => Semigroup (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Max a -> Max a -> Max a #sconcat :: NonEmpty (Max a) -> Max a #stimes :: Integral b => b -> Max a -> Max a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: First a -> First a -> First a #sconcat :: NonEmpty (First a) -> First a #stimes :: Integral b => b -> First a -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Last a -> Last a -> Last a #sconcat :: NonEmpty (Last a) -> Last a #stimes :: Integral b => b -> Last a -> Last a # Monoid m => Semigroup (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m #stimes :: Integral b => b -> WrappedMonoid m -> WrappedMonoid m # Semigroup a => Semigroup (Option a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Option a -> Option a -> Option a #sconcat :: NonEmpty (Option a) -> Option a #stimes :: Integral b => b -> Option a -> Option a # Semigroup a => Semigroup (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity Methods(<>) :: Identity a -> Identity a -> Identity a #sconcat :: NonEmpty (Identity a) -> Identity a #stimes :: Integral b => b -> Identity a -> Identity a # Since: base-4.9.0.0 Instance detailsDefined in Data.Monoid Methods(<>) :: First a -> First a -> First a #sconcat :: NonEmpty (First a) -> First a #stimes :: Integral b => b -> First a -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Monoid Methods(<>) :: Last a -> Last a -> Last a #sconcat :: NonEmpty (Last a) -> Last a #stimes :: Integral b => b -> Last a -> Last a # Semigroup a => Semigroup (Dual a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Dual a -> Dual a -> Dual a #sconcat :: NonEmpty (Dual a) -> Dual a #stimes :: Integral b => b -> Dual a -> Dual a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Endo a -> Endo a -> Endo a #sconcat :: NonEmpty (Endo a) -> Endo a #stimes :: Integral b => b -> Endo a -> Endo a # Num a => Semigroup (Sum a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Sum a -> Sum a -> Sum a #sconcat :: NonEmpty (Sum a) -> Sum a #stimes :: Integral b => b -> Sum a -> Sum a # Num a => Semigroup (Product a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Product a -> Product a -> Product a #sconcat :: NonEmpty (Product a) -> Product a #stimes :: Integral b => b -> Product a -> Product a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a #sconcat :: NonEmpty (NonEmpty a) -> NonEmpty a #stimes :: Integral b => b -> NonEmpty a -> NonEmpty a # Semigroup b => Semigroup (a -> b) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a -> b) -> (a -> b) -> a -> b #sconcat :: NonEmpty (a -> b) -> a -> b #stimes :: Integral b0 => b0 -> (a -> b) -> a -> b # Semigroup (Either a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Either Methods(<>) :: Either a b -> Either a b -> Either a b #sconcat :: NonEmpty (Either a b) -> Either a b #stimes :: Integral b0 => b0 -> Either a b -> Either a b # (Semigroup a, Semigroup b) => Semigroup (a, b) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a, b) -> (a, b) -> (a, b) #sconcat :: NonEmpty (a, b) -> (a, b) #stimes :: Integral b0 => b0 -> (a, b) -> (a, b) # Semigroup a => Semigroup (Op a b) Instance detailsDefined in Data.Functor.Contravariant Methods(<>) :: Op a b -> Op a b -> Op a b #sconcat :: NonEmpty (Op a b) -> Op a b #stimes :: Integral b0 => b0 -> Op a b -> Op a b # Since: base-4.9.0.0 Instance detailsDefined in Data.Proxy Methods(<>) :: Proxy s -> Proxy s -> Proxy s #sconcat :: NonEmpty (Proxy s) -> Proxy s #stimes :: Integral b => b -> Proxy s -> Proxy s # (Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a, b, c) -> (a, b, c) -> (a, b, c) #sconcat :: NonEmpty (a, b, c) -> (a, b, c) #stimes :: Integral b0 => b0 -> (a, b, c) -> (a, b, c) # Semigroup a => Semigroup (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methods(<>) :: Const a b -> Const a b -> Const a b #sconcat :: NonEmpty (Const a b) -> Const a b #stimes :: Integral b0 => b0 -> Const a b -> Const a b # (Applicative f, Semigroup a) => Semigroup (Ap f a) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methods(<>) :: Ap f a -> Ap f a -> Ap f a #sconcat :: NonEmpty (Ap f a) -> Ap f a #stimes :: Integral b => b -> Ap f a -> Ap f a # Alternative f => Semigroup (Alt f a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Alt f a -> Alt f a -> Alt f a #sconcat :: NonEmpty (Alt f a) -> Alt f a #stimes :: Integral b => b -> Alt f a -> Alt f a # (Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #sconcat :: NonEmpty (a, b, c, d) -> (a, b, c, d) #stimes :: Integral b0 => b0 -> (a, b, c, d) -> (a, b, c, d) # (Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(<>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #sconcat :: NonEmpty (a, b, c, d, e) -> (a, b, c, d, e) #stimes :: Integral b0 => b0 -> (a, b, c, d, e) -> (a, b, c, d, e) # stimesMonoid :: (Integral b, Monoid a) => 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. stimesIdempotent :: Integral b => 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 $$\mathcal{O}(1)$$ rather than $$\mathcal{O}(\log n)$$. stimesIdempotentMonoid :: (Integral b, Monoid a) => 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 $$\mathcal{O}(1)$$ rather than $$\mathcal{O}(\log n)$$ mtimesDefault :: (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. # Semigroups newtype Min a # Constructors  Min FieldsgetMin :: a #### Instances Instances details  Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Min a -> (a -> Min b) -> Min b #(>>) :: Min a -> Min b -> Min b #return :: a -> Min a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsfmap :: (a -> b) -> Min a -> Min b #(<$) :: a -> Min b -> Min a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmfix :: (a -> Min a) -> Min a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Min a #(<*>) :: Min (a -> b) -> Min a -> Min b #liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c #(*>) :: Min a -> Min b -> Min b #(<*) :: Min a -> Min b -> Min a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsfold :: Monoid m => Min m -> m #foldMap :: Monoid m => (a -> m) -> Min a -> m #foldMap' :: Monoid m => (a -> m) -> Min a -> m #foldr :: (a -> b -> b) -> b -> Min a -> b #foldr' :: (a -> b -> b) -> b -> Min a -> b #foldl :: (b -> a -> b) -> b -> Min a -> b #foldl' :: (b -> a -> b) -> b -> Min a -> b #foldr1 :: (a -> a -> a) -> Min a -> a #foldl1 :: (a -> a -> a) -> Min a -> a #toList :: Min a -> [a] #null :: Min a -> Bool #length :: Min a -> Int #elem :: Eq a => a -> Min a -> Bool #maximum :: Ord a => Min a -> a #minimum :: Ord a => Min a -> a #sum :: Num a => Min a -> a #product :: Num a => Min a -> a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodstraverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) #sequenceA :: Applicative f => Min (f a) -> f (Min a) #mapM :: Monad m => (a -> m b) -> Min a -> m (Min b) #sequence :: Monad m => Min (m a) -> m (Min a) # Bounded a => Bounded (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsminBound :: Min a #maxBound :: Min a # Enum a => Enum (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodssucc :: Min a -> Min a #pred :: Min a -> Min a #toEnum :: Int -> Min a #fromEnum :: Min a -> Int #enumFrom :: Min a -> [Min a] #enumFromThen :: Min a -> Min a -> [Min a] #enumFromTo :: Min a -> Min a -> [Min a] #enumFromThenTo :: Min a -> Min a -> Min a -> [Min a] # Eq a => Eq (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Min a -> Min a -> Bool #(/=) :: Min a -> Min a -> Bool # Data a => Data (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Min a -> c (Min a) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Min a) #toConstr :: Min a -> Constr #dataTypeOf :: Min a -> DataType #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Min a)) #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Min a)) #gmapT :: (forall b. Data b => b -> b) -> Min a -> Min a #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Min a -> r #gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Min a -> r #gmapQ :: (forall d. Data d => d -> u) -> Min a -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> Min a -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Min a -> m (Min a) # Num a => Num (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(+) :: Min a -> Min a -> Min a #(-) :: Min a -> Min a -> Min a #(*) :: Min a -> Min a -> Min a #negate :: Min a -> Min a #abs :: Min a -> Min a #signum :: Min a -> Min a # Ord a => Ord (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodscompare :: Min a -> Min a -> Ordering #(<) :: Min a -> Min a -> Bool #(<=) :: Min a -> Min a -> Bool #(>) :: Min a -> Min a -> Bool #(>=) :: Min a -> Min a -> Bool #max :: Min a -> Min a -> Min a #min :: Min a -> Min a -> Min a # Read a => Read (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsreadsPrec :: Int -> ReadS (Min a) #readList :: ReadS [Min a] #readPrec :: ReadPrec (Min a) # Show a => Show (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsshowsPrec :: Int -> Min a -> ShowS #show :: Min a -> String #showList :: [Min a] -> ShowS # Generic (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep (Min a) :: Type -> Type # Methodsfrom :: Min a -> Rep (Min a) x #to :: Rep (Min a) x -> Min a # Ord a => Semigroup (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Min a -> Min a -> Min a #sconcat :: NonEmpty (Min a) -> Min a #stimes :: Integral b => b -> Min a -> Min a # (Ord a, Bounded a) => Monoid (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmempty :: Min a #mappend :: Min a -> Min a -> Min a #mconcat :: [Min a] -> Min a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep1 Min :: k -> Type # Methodsfrom1 :: forall (a :: k). Min a -> Rep1 Min a #to1 :: forall (a :: k). Rep1 Min a -> Min a # type Rep (Min a) Instance detailsDefined in Data.Semigroup type Rep (Min a) = D1 ('MetaData "Min" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "Min" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) type Rep1 Min Instance detailsDefined in Data.Semigroup type Rep1 Min = D1 ('MetaData "Min" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "Min" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))

newtype Max a #

Constructors

 Max FieldsgetMax :: a

#### Instances

Instances details
 Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Max a -> (a -> Max b) -> Max b #(>>) :: Max a -> Max b -> Max b #return :: a -> Max a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsfmap :: (a -> b) -> Max a -> Max b #(<$) :: a -> Max b -> Max a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmfix :: (a -> Max a) -> Max a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Max a #(<*>) :: Max (a -> b) -> Max a -> Max b #liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c #(*>) :: Max a -> Max b -> Max b #(<*) :: Max a -> Max b -> Max a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsfold :: Monoid m => Max m -> m #foldMap :: Monoid m => (a -> m) -> Max a -> m #foldMap' :: Monoid m => (a -> m) -> Max a -> m #foldr :: (a -> b -> b) -> b -> Max a -> b #foldr' :: (a -> b -> b) -> b -> Max a -> b #foldl :: (b -> a -> b) -> b -> Max a -> b #foldl' :: (b -> a -> b) -> b -> Max a -> b #foldr1 :: (a -> a -> a) -> Max a -> a #foldl1 :: (a -> a -> a) -> Max a -> a #toList :: Max a -> [a] #null :: Max a -> Bool #length :: Max a -> Int #elem :: Eq a => a -> Max a -> Bool #maximum :: Ord a => Max a -> a #minimum :: Ord a => Max a -> a #sum :: Num a => Max a -> a #product :: Num a => Max a -> a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodstraverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) #sequenceA :: Applicative f => Max (f a) -> f (Max a) #mapM :: Monad m => (a -> m b) -> Max a -> m (Max b) #sequence :: Monad m => Max (m a) -> m (Max a) # Bounded a => Bounded (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsminBound :: Max a #maxBound :: Max a # Enum a => Enum (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodssucc :: Max a -> Max a #pred :: Max a -> Max a #toEnum :: Int -> Max a #fromEnum :: Max a -> Int #enumFrom :: Max a -> [Max a] #enumFromThen :: Max a -> Max a -> [Max a] #enumFromTo :: Max a -> Max a -> [Max a] #enumFromThenTo :: Max a -> Max a -> Max a -> [Max a] # Eq a => Eq (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Max a -> Max a -> Bool #(/=) :: Max a -> Max a -> Bool # Data a => Data (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Max a -> c (Max a) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Max a) #toConstr :: Max a -> Constr #dataTypeOf :: Max a -> DataType #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Max a)) #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Max a)) #gmapT :: (forall b. Data b => b -> b) -> Max a -> Max a #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Max a -> r #gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Max a -> r #gmapQ :: (forall d. Data d => d -> u) -> Max a -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> Max a -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Max a -> m (Max a) # Num a => Num (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(+) :: Max a -> Max a -> Max a #(-) :: Max a -> Max a -> Max a #(*) :: Max a -> Max a -> Max a #negate :: Max a -> Max a #abs :: Max a -> Max a #signum :: Max a -> Max a # Ord a => Ord (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodscompare :: Max a -> Max a -> Ordering #(<) :: Max a -> Max a -> Bool #(<=) :: Max a -> Max a -> Bool #(>) :: Max a -> Max a -> Bool #(>=) :: Max a -> Max a -> Bool #max :: Max a -> Max a -> Max a #min :: Max a -> Max a -> Max a # Read a => Read (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsreadsPrec :: Int -> ReadS (Max a) #readList :: ReadS [Max a] #readPrec :: ReadPrec (Max a) # Show a => Show (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsshowsPrec :: Int -> Max a -> ShowS #show :: Max a -> String #showList :: [Max a] -> ShowS # Generic (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep (Max a) :: Type -> Type # Methodsfrom :: Max a -> Rep (Max a) x #to :: Rep (Max a) x -> Max a # Ord a => Semigroup (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Max a -> Max a -> Max a #sconcat :: NonEmpty (Max a) -> Max a #stimes :: Integral b => b -> Max a -> Max a # (Ord a, Bounded a) => Monoid (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmempty :: Max a #mappend :: Max a -> Max a -> Max a #mconcat :: [Max a] -> Max a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep1 Max :: k -> Type # Methodsfrom1 :: forall (a :: k). Max a -> Rep1 Max a #to1 :: forall (a :: k). Rep1 Max a -> Max a # type Rep (Max a) Instance detailsDefined in Data.Semigroup type Rep (Max a) = D1 ('MetaData "Max" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "Max" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMax") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) type Rep1 Max Instance detailsDefined in Data.Semigroup type Rep1 Max = D1 ('MetaData "Max" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "Max" 'PrefixI 'True) (S1 ('MetaSel ('Just "getMax") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) newtype First a # Use Option (First a) to get the behavior of First from Data.Monoid. Constructors  First FieldsgetFirst :: a #### Instances Instances details  Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: First a -> (a -> First b) -> First b #(>>) :: First a -> First b -> First b #return :: a -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsfmap :: (a -> b) -> First a -> First b #(<$) :: a -> First b -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmfix :: (a -> First a) -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> First a #(<*>) :: First (a -> b) -> First a -> First b #liftA2 :: (a -> b -> c) -> First a -> First b -> First c #(*>) :: First a -> First b -> First b #(<*) :: First a -> First b -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsfold :: Monoid m => First m -> m #foldMap :: Monoid m => (a -> m) -> First a -> m #foldMap' :: Monoid m => (a -> m) -> First a -> m #foldr :: (a -> b -> b) -> b -> First a -> b #foldr' :: (a -> b -> b) -> b -> First a -> b #foldl :: (b -> a -> b) -> b -> First a -> b #foldl' :: (b -> a -> b) -> b -> First a -> b #foldr1 :: (a -> a -> a) -> First a -> a #foldl1 :: (a -> a -> a) -> First a -> a #toList :: First a -> [a] #null :: First a -> Bool #length :: First a -> Int #elem :: Eq a => a -> First a -> Bool #maximum :: Ord a => First a -> a #minimum :: Ord a => First a -> a #sum :: Num a => First a -> a #product :: Num a => First a -> a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodstraverse :: Applicative f => (a -> f b) -> First a -> f (First b) #sequenceA :: Applicative f => First (f a) -> f (First a) #mapM :: Monad m => (a -> m b) -> First a -> m (First b) #sequence :: Monad m => First (m a) -> m (First a) # Bounded a => Bounded (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods Enum a => Enum (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodssucc :: First a -> First a #pred :: First a -> First a #toEnum :: Int -> First a #fromEnum :: First a -> Int #enumFrom :: First a -> [First a] #enumFromThen :: First a -> First a -> [First a] #enumFromTo :: First a -> First a -> [First a] #enumFromThenTo :: First a -> First a -> First a -> [First a] # Eq a => Eq (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: First a -> First a -> Bool #(/=) :: First a -> First a -> Bool # Data a => Data (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> First a -> c (First a) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (First a) #toConstr :: First a -> Constr #dataTypeOf :: First a -> DataType #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (First a)) #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (First a)) #gmapT :: (forall b. Data b => b -> b) -> First a -> First a #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r #gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> First a -> r #gmapQ :: (forall d. Data d => d -> u) -> First a -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> First a -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> First a -> m (First a) #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> First a -> m (First a) # Ord a => Ord (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodscompare :: First a -> First a -> Ordering #(<) :: First a -> First a -> Bool #(<=) :: First a -> First a -> Bool #(>) :: First a -> First a -> Bool #(>=) :: First a -> First a -> Bool #max :: First a -> First a -> First a #min :: First a -> First a -> First a # Read a => Read (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsreadsPrec :: Int -> ReadS (First a) #readList :: ReadS [First a] # Show a => Show (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsshowsPrec :: Int -> First a -> ShowS #show :: First a -> String #showList :: [First a] -> ShowS # Generic (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep (First a) :: Type -> Type # Methodsfrom :: First a -> Rep (First a) x #to :: Rep (First a) x -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: First a -> First a -> First a #sconcat :: NonEmpty (First a) -> First a #stimes :: Integral b => b -> First a -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep1 First :: k -> Type # Methodsfrom1 :: forall (a :: k). First a -> Rep1 First a #to1 :: forall (a :: k). Rep1 First a -> First a # type Rep (First a) Instance detailsDefined in Data.Semigroup type Rep (First a) = D1 ('MetaData "First" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "First" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFirst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) type Rep1 First Instance detailsDefined in Data.Semigroup type Rep1 First = D1 ('MetaData "First" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "First" 'PrefixI 'True) (S1 ('MetaSel ('Just "getFirst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))

newtype Last a #

Use Option (Last a) to get the behavior of Last from Data.Monoid

Constructors

 Last FieldsgetLast :: a

#### Instances

Instances details
 Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Last a -> (a -> Last b) -> Last b #(>>) :: Last a -> Last b -> Last b #return :: a -> Last a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsfmap :: (a -> b) -> Last a -> Last b #(<$) :: a -> Last b -> Last a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmfix :: (a -> Last a) -> Last a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Last a #(<*>) :: Last (a -> b) -> Last a -> Last b #liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c #(*>) :: Last a -> Last b -> Last b #(<*) :: Last a -> Last b -> Last a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsfold :: Monoid m => Last m -> m #foldMap :: Monoid m => (a -> m) -> Last a -> m #foldMap' :: Monoid m => (a -> m) -> Last a -> m #foldr :: (a -> b -> b) -> b -> Last a -> b #foldr' :: (a -> b -> b) -> b -> Last a -> b #foldl :: (b -> a -> b) -> b -> Last a -> b #foldl' :: (b -> a -> b) -> b -> Last a -> b #foldr1 :: (a -> a -> a) -> Last a -> a #foldl1 :: (a -> a -> a) -> Last a -> a #toList :: Last a -> [a] #null :: Last a -> Bool #length :: Last a -> Int #elem :: Eq a => a -> Last a -> Bool #maximum :: Ord a => Last a -> a #minimum :: Ord a => Last a -> a #sum :: Num a => Last a -> a #product :: Num a => Last a -> a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodstraverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) #sequenceA :: Applicative f => Last (f a) -> f (Last a) #mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) #sequence :: Monad m => Last (m a) -> m (Last a) # Bounded a => Bounded (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods Enum a => Enum (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodssucc :: Last a -> Last a #pred :: Last a -> Last a #toEnum :: Int -> Last a #fromEnum :: Last a -> Int #enumFrom :: Last a -> [Last a] #enumFromThen :: Last a -> Last a -> [Last a] #enumFromTo :: Last a -> Last a -> [Last a] #enumFromThenTo :: Last a -> Last a -> Last a -> [Last a] # Eq a => Eq (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Last a -> Last a -> Bool #(/=) :: Last a -> Last a -> Bool # Data a => Data (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Last a -> c (Last a) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Last a) #toConstr :: Last a -> Constr #dataTypeOf :: Last a -> DataType #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Last a)) #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Last a)) #gmapT :: (forall b. Data b => b -> b) -> Last a -> Last a #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r #gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Last a -> r #gmapQ :: (forall d. Data d => d -> u) -> Last a -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> Last a -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Last a -> m (Last a) # Ord a => Ord (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodscompare :: Last a -> Last a -> Ordering #(<) :: Last a -> Last a -> Bool #(<=) :: Last a -> Last a -> Bool #(>) :: Last a -> Last a -> Bool #(>=) :: Last a -> Last a -> Bool #max :: Last a -> Last a -> Last a #min :: Last a -> Last a -> Last a # Read a => Read (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsreadsPrec :: Int -> ReadS (Last a) #readList :: ReadS [Last a] # Show a => Show (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsshowsPrec :: Int -> Last a -> ShowS #show :: Last a -> String #showList :: [Last a] -> ShowS # Generic (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep (Last a) :: Type -> Type # Methodsfrom :: Last a -> Rep (Last a) x #to :: Rep (Last a) x -> Last a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: Last a -> Last a -> Last a #sconcat :: NonEmpty (Last a) -> Last a #stimes :: Integral b => b -> Last a -> Last a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep1 Last :: k -> Type # Methodsfrom1 :: forall (a :: k). Last a -> Rep1 Last a #to1 :: forall (a :: k). Rep1 Last a -> Last a # type Rep (Last a) Instance detailsDefined in Data.Semigroup type Rep (Last a) = D1 ('MetaData "Last" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "Last" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLast") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) type Rep1 Last Instance detailsDefined in Data.Semigroup type Rep1 Last = D1 ('MetaData "Last" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "Last" 'PrefixI 'True) (S1 ('MetaSel ('Just "getLast") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) newtype WrappedMonoid m # Provide a Semigroup for an arbitrary Monoid. NOTE: This is not needed anymore since Semigroup became a superclass of Monoid in base-4.11 and this newtype be deprecated at some point in the future. Constructors  WrapMonoid FieldsunwrapMonoid :: m #### Instances Instances details  Bounded m => Bounded (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods Enum a => Enum (WrappedMonoid a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsenumFrom :: WrappedMonoid a -> [WrappedMonoid a] #enumFromThen :: WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] #enumFromTo :: WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] #enumFromThenTo :: WrappedMonoid a -> WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] # Eq m => Eq (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # Data m => Data (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> WrappedMonoid m -> c (WrappedMonoid m) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (WrappedMonoid m) #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (WrappedMonoid m)) #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (WrappedMonoid m)) #gmapT :: (forall b. Data b => b -> b) -> WrappedMonoid m -> WrappedMonoid m #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonoid m -> r #gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> WrappedMonoid m -> r #gmapQ :: (forall d. Data d => d -> u) -> WrappedMonoid m -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> WrappedMonoid m -> u #gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) #gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) #gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> WrappedMonoid m -> m0 (WrappedMonoid m) # Ord m => Ord (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(<=) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(>) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(>=) :: WrappedMonoid m -> WrappedMonoid m -> Bool #max :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m #min :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # Read m => Read (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods Show m => Show (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup MethodsshowsPrec :: Int -> WrappedMonoid m -> ShowS #show :: WrappedMonoid m -> String #showList :: [WrappedMonoid m] -> ShowS # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep (WrappedMonoid m) :: Type -> Type # Methodsfrom :: WrappedMonoid m -> Rep (WrappedMonoid m) x #to :: Rep (WrappedMonoid m) x -> WrappedMonoid m # Monoid m => Semigroup (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(<>) :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m #stimes :: Integral b => b -> WrappedMonoid m -> WrappedMonoid m # Monoid m => Monoid (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsmconcat :: [WrappedMonoid m] -> WrappedMonoid m # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Associated Typestype Rep1 WrappedMonoid :: k -> Type # Methodsfrom1 :: forall (a :: k). WrappedMonoid a -> Rep1 WrappedMonoid a #to1 :: forall (a :: k). Rep1 WrappedMonoid a -> WrappedMonoid a # type Rep (WrappedMonoid m) Instance detailsDefined in Data.Semigroup type Rep (WrappedMonoid m) = D1 ('MetaData "WrappedMonoid" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "WrapMonoid" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapMonoid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m))) Instance detailsDefined in Data.Semigroup type Rep1 WrappedMonoid = D1 ('MetaData "WrappedMonoid" "Data.Semigroup" "base" 'True) (C1 ('MetaCons "WrapMonoid" 'PrefixI 'True) (S1 ('MetaSel ('Just "unwrapMonoid") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1)) # Re-exported monoids from Data.Monoid newtype Dual a # The dual of a Monoid, obtained by swapping the arguments of mappend. >>> getDual (mappend (Dual "Hello") (Dual "World")) "WorldHello" Constructors  Dual FieldsgetDual :: a #### Instances Instances details  Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(>>=) :: Dual a -> (a -> Dual b) -> Dual b #(>>) :: Dual a -> Dual b -> Dual b #return :: a -> Dual a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodsfmap :: (a -> b) -> Dual a -> Dual b #(<$) :: a -> Dual b -> Dual a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodspure :: a -> Dual a #(<*>) :: Dual (a -> b) -> Dual a -> Dual b #liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c #(*>) :: Dual a -> Dual b -> Dual b #(<*) :: Dual a -> Dual b -> Dual a # Since: base-4.8.0.0 Instance detailsDefined in Data.Foldable Methodsfold :: Monoid m => Dual m -> m #foldMap :: Monoid m => (a -> m) -> Dual a -> m #foldMap' :: Monoid m => (a -> m) -> Dual a -> m #foldr :: (a -> b -> b) -> b -> Dual a -> b #foldr' :: (a -> b -> b) -> b -> Dual a -> b #foldl :: (b -> a -> b) -> b -> Dual a -> b #foldl' :: (b -> a -> b) -> b -> Dual a -> b #foldr1 :: (a -> a -> a) -> Dual a -> a #foldl1 :: (a -> a -> a) -> Dual a -> a #toList :: Dual a -> [a] #null :: Dual a -> Bool #length :: Dual a -> Int #elem :: Eq a => a -> Dual a -> Bool #maximum :: Ord a => Dual a -> a #minimum :: Ord a => Dual a -> a #sum :: Num a => Dual a -> a #product :: Num a => Dual a -> a # Since: base-4.8.0.0 Instance detailsDefined in Data.Traversable Methodstraverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) #sequenceA :: Applicative f => Dual (f a) -> f (Dual a) #mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) #sequence :: Monad m => Dual (m a) -> m (Dual a) # Bounded a => Bounded (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Eq a => Eq (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: Dual a -> Dual a -> Bool #(/=) :: Dual a -> Dual a -> Bool # Ord a => Ord (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodscompare :: Dual a -> Dual a -> Ordering #(<) :: Dual a -> Dual a -> Bool #(<=) :: Dual a -> Dual a -> Bool #(>) :: Dual a -> Dual a -> Bool #(>=) :: Dual a -> Dual a -> Bool #max :: Dual a -> Dual a -> Dual a #min :: Dual a -> Dual a -> Dual a # Read a => Read (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal MethodsreadsPrec :: Int -> ReadS (Dual a) #readList :: ReadS [Dual a] # Show a => Show (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal MethodsshowsPrec :: Int -> Dual a -> ShowS #show :: Dual a -> String #showList :: [Dual a] -> ShowS # Generic (Dual a) Since: base-4.7.0.0 Instance detailsDefined in Data.Semigroup.Internal Associated Typestype Rep (Dual a) :: Type -> Type # Methodsfrom :: Dual a -> Rep (Dual a) x #to :: Rep (Dual a) x -> Dual a # Semigroup a => Semigroup (Dual a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Dual a -> Dual a -> Dual a #sconcat :: NonEmpty (Dual a) -> Dual a #stimes :: Integral b => b -> Dual a -> Dual a # Monoid a => Monoid (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmempty :: Dual a #mappend :: Dual a -> Dual a -> Dual a #mconcat :: [Dual a] -> Dual a # Since: base-4.7.0.0 Instance detailsDefined in Data.Semigroup.Internal Associated Typestype Rep1 Dual :: k -> Type # Methodsfrom1 :: forall (a :: k). Dual a -> Rep1 Dual a #to1 :: forall (a :: k). Rep1 Dual a -> Dual a # type Rep (Dual a) Instance detailsDefined in Data.Semigroup.Internal type Rep (Dual a) = D1 ('MetaData "Dual" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "Dual" 'PrefixI 'True) (S1 ('MetaSel ('Just "getDual") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) type Rep1 Dual Instance detailsDefined in Data.Semigroup.Internal type Rep1 Dual = D1 ('MetaData "Dual" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "Dual" 'PrefixI 'True) (S1 ('MetaSel ('Just "getDual") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))

newtype Endo a #

The monoid of endomorphisms under composition.

>>> let computation = Endo ("Hello, " ++) <> Endo (++ "!")

Constructors

 Endo FieldsappEndo :: a -> a

#### Instances

Instances details
 Generic (Endo a) Since: base-4.7.0.0 Instance detailsDefined in Data.Semigroup.Internal Associated Typestype Rep (Endo a) :: Type -> Type # Methodsfrom :: Endo a -> Rep (Endo a) x #to :: Rep (Endo a) x -> Endo a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Endo a -> Endo a -> Endo a #sconcat :: NonEmpty (Endo a) -> Endo a #stimes :: Integral b => b -> Endo a -> Endo a # Monoid (Endo a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmempty :: Endo a #mappend :: Endo a -> Endo a -> Endo a #mconcat :: [Endo a] -> Endo a # type Rep (Endo a) Instance detailsDefined in Data.Semigroup.Internal type Rep (Endo a) = D1 ('MetaData "Endo" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "Endo" 'PrefixI 'True) (S1 ('MetaSel ('Just "appEndo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (a -> a))))

newtype All #

Boolean monoid under conjunction (&&).

>>> getAll (All True <> mempty <> All False)
False
>>> getAll (mconcat (map (\x -> All (even x)) [2,4,6,7,8]))
False

Constructors

 All FieldsgetAll :: Bool

#### Instances

Instances details
 Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: All -> All -> Bool #(/=) :: All -> All -> Bool # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodscompare :: All -> All -> Ordering #(<) :: All -> All -> Bool #(<=) :: All -> All -> Bool #(>) :: All -> All -> Bool #(>=) :: All -> All -> Bool #max :: All -> All -> All #min :: All -> All -> All # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal MethodsshowsPrec :: Int -> All -> ShowS #show :: All -> String #showList :: [All] -> ShowS # Since: base-4.7.0.0 Instance detailsDefined in Data.Semigroup.Internal Associated Typestype Rep All :: Type -> Type # Methodsfrom :: All -> Rep All x #to :: Rep All x -> All # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: All -> All -> All #stimes :: Integral b => b -> All -> All # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmappend :: All -> All -> All #mconcat :: [All] -> All # type Rep All Instance detailsDefined in Data.Semigroup.Internal type Rep All = D1 ('MetaData "All" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "All" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

newtype Any #

Boolean monoid under disjunction (||).

>>> getAny (Any True <> mempty <> Any False)
True
>>> getAny (mconcat (map (\x -> Any (even x)) [2,4,6,7,8]))
True

Constructors

 Any FieldsgetAny :: Bool

#### Instances

Instances details
 Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: Any -> Any -> Bool #(/=) :: Any -> Any -> Bool # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodscompare :: Any -> Any -> Ordering #(<) :: Any -> Any -> Bool #(<=) :: Any -> Any -> Bool #(>) :: Any -> Any -> Bool #(>=) :: Any -> Any -> Bool #max :: Any -> Any -> Any #min :: Any -> Any -> Any # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal MethodsshowsPrec :: Int -> Any -> ShowS #show :: Any -> String #showList :: [Any] -> ShowS # Since: base-4.7.0.0 Instance detailsDefined in Data.Semigroup.Internal Associated Typestype Rep Any :: Type -> Type # Methodsfrom :: Any -> Rep Any x #to :: Rep Any x -> Any # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Any -> Any -> Any #stimes :: Integral b => b -> Any -> Any # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methodsmappend :: Any -> Any -> Any #mconcat :: [Any] -> Any # type Rep Any Instance detailsDefined in Data.Semigroup.Internal type Rep Any = D1 ('MetaData "Any" "Data.Semigroup.Internal" "base" 'True) (C1 ('MetaCons "Any" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAny") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))

newtype Sum a #

>>> getSum (Sum 1 <> Sum 2 <> mempty)
3

Constructors

 Sum FieldsgetSum :: a

#### Instances

Instances details

# Difference lists of a semigroup

diff :: Semigroup m => m -> Endo m #

This lets you use a difference list of a Semigroup as a Monoid.

cycle1 :: Semigroup m => m -> m #

A generalization of cycle to an arbitrary Semigroup. May fail to terminate for some values in some semigroups.

# ArgMin, ArgMax

data Arg a b #

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.

Constructors

 Arg a b

#### Instances

Instances details