concat-classes-0.3.0.0: Constrained categories
Safe HaskellSafe-Inferred
LanguageHaskell2010

ConCat.Additive

Description

Commutative monoid intended to be used with a multiplicative monoid

Synopsis

Documentation

class Additive a where Source #

Commutative monoid intended to be used with a multiplicative monoid

Minimal complete definition

Nothing

Methods

zero :: a Source #

default zero :: (Pointed h, Additive b, a ~ h b) => a Source #

(^+^) :: a -> a -> a infixl 6 Source #

default (^+^) :: (Zip h, Additive b, a ~ h b) => Binop a Source #

Instances

Instances details
Additive CDouble Source # 
Instance details

Defined in ConCat.Additive

Additive CFloat Source # 
Instance details

Defined in ConCat.Additive

Additive CInt Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: CInt Source #

(^+^) :: CInt -> CInt -> CInt Source #

Additive CIntMax Source # 
Instance details

Defined in ConCat.Additive

Additive CLLong Source # 
Instance details

Defined in ConCat.Additive

Additive CLong Source # 
Instance details

Defined in ConCat.Additive

Additive CSChar Source # 
Instance details

Defined in ConCat.Additive

Additive CShort Source # 
Instance details

Defined in ConCat.Additive

Additive Int16 Source # 
Instance details

Defined in ConCat.Additive

Additive Int32 Source # 
Instance details

Defined in ConCat.Additive

Additive Int64 Source # 
Instance details

Defined in ConCat.Additive

Additive Int8 Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Int8 Source #

(^+^) :: Int8 -> Int8 -> Int8 Source #

Additive Word16 Source # 
Instance details

Defined in ConCat.Additive

Additive Word32 Source # 
Instance details

Defined in ConCat.Additive

Additive Word64 Source # 
Instance details

Defined in ConCat.Additive

Additive Word8 Source # 
Instance details

Defined in ConCat.Additive

Additive Integer Source # 
Instance details

Defined in ConCat.Additive

Additive () Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: () Source #

(^+^) :: () -> () -> () Source #

Additive Bool Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Bool Source #

(^+^) :: Bool -> Bool -> Bool Source #

Additive Double Source # 
Instance details

Defined in ConCat.Additive

Additive Float Source # 
Instance details

Defined in ConCat.Additive

Additive Int Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Int Source #

(^+^) :: Int -> Int -> Int Source #

Additive Word Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Word Source #

(^+^) :: Word -> Word -> Word Source #

OpCon (:*) (Sat Additive) Source # 
Instance details

Defined in ConCat.Category

Methods

inOp :: forall (a :: k) (b :: k). (Sat Additive a && Sat Additive b) |- Sat Additive (a :* b) Source #

OpCon (->) (Sat Additive) Source # 
Instance details

Defined in ConCat.Category

Methods

inOp :: forall (a :: k) (b :: k). (Sat Additive a && Sat Additive b) |- Sat Additive (a -> b) Source #

(RealFloat v, Additive v) => Additive (Complex v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Complex v Source #

(^+^) :: Complex v -> Complex v -> Complex v Source #

(AddF Product, Additive v) => Additive (Product v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Product v Source #

(^+^) :: Product v -> Product v -> Product v Source #

(AddF Sum, Additive v) => Additive (Sum v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Sum v Source #

(^+^) :: Sum v -> Sum v -> Sum v Source #

(AddF Par1, Additive v) => Additive (Par1 v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Par1 v Source #

(^+^) :: Par1 v -> Par1 v -> Par1 v Source #

Integral a => Additive (Ratio a) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Ratio a Source #

(^+^) :: Ratio a -> Ratio a -> Ratio a Source #

Additive a => Additive (Add a) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Add a Source #

(^+^) :: Add a -> Add a -> Add a Source #

KnownNat n => Additive (Finite n) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Finite n Source #

(^+^) :: Finite n -> Finite n -> Finite n Source #

Additive a => Additive (Maybe a) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Maybe a Source #

(^+^) :: Maybe a -> Maybe a -> Maybe a Source #

(AddF (U1 :: Type -> Type), Additive v) => Additive (U1 v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: U1 v Source #

(^+^) :: U1 v -> U1 v -> U1 v Source #

(Additive v, KnownNat n) => Additive (Vector n v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Vector n v Source #

(^+^) :: Vector n v -> Vector n v -> Vector n v Source #

(Additive u, Additive v) => Additive (u, v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: (u, v) Source #

(^+^) :: (u, v) -> (u, v) -> (u, v) Source #

(Additive u, Additive v, Additive w) => Additive (u, v, w) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: (u, v, w) Source #

(^+^) :: (u, v, w) -> (u, v, w) -> (u, v, w) Source #

(AddF (f :*: g), Additive v) => Additive ((f :*: g) v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: (f :*: g) v Source #

(^+^) :: (f :*: g) v -> (f :*: g) v -> (f :*: g) v Source #

(Additive u, Additive v, Additive w, Additive x) => Additive (u, v, w, x) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: (u, v, w, x) Source #

(^+^) :: (u, v, w, x) -> (u, v, w, x) -> (u, v, w, x) Source #

(AddF ((->) a), Additive v) => Additive (a -> v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: a -> v Source #

(^+^) :: (a -> v) -> (a -> v) -> a -> v Source #

(AddF (g :.: f), Additive v) => Additive ((g :.: f) v) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: (g :.: f) v Source #

(^+^) :: (g :.: f) v -> (g :.: f) v -> (g :.: f) v Source #

pointNI :: Pointed h => a -> h a Source #

zipWithNI :: Zip h => (a -> b -> c) -> h a -> h b -> h c Source #

type AddF f = (Pointed f, Zip f) Source #

newtype Add a Source #

Monoid under group addition. Alternative to the Sum in Data.Monoid, which uses Num instead of Additive.

Constructors

Add 

Fields

Instances

Instances details
Applicative Add Source # 
Instance details

Defined in ConCat.Additive

Methods

pure :: a -> Add a Source #

(<*>) :: Add (a -> b) -> Add a -> Add b Source #

liftA2 :: (a -> b -> c) -> Add a -> Add b -> Add c Source #

(*>) :: Add a -> Add b -> Add b Source #

(<*) :: Add a -> Add b -> Add a Source #

Functor Add Source # 
Instance details

Defined in ConCat.Additive

Methods

fmap :: (a -> b) -> Add a -> Add b Source #

(<$) :: a -> Add b -> Add a Source #

Additive a => Monoid (Add a) Source # 
Instance details

Defined in ConCat.Additive

Methods

mempty :: Add a Source #

mappend :: Add a -> Add a -> Add a Source #

mconcat :: [Add a] -> Add a Source #

Additive a => Semigroup (Add a) Source # 
Instance details

Defined in ConCat.Additive

Methods

(<>) :: Add a -> Add a -> Add a Source #

sconcat :: NonEmpty (Add a) -> Add a Source #

stimes :: Integral b => b -> Add a -> Add a Source #

Bounded a => Bounded (Add a) Source # 
Instance details

Defined in ConCat.Additive

Read a => Read (Add a) Source # 
Instance details

Defined in ConCat.Additive

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

Defined in ConCat.Additive

Methods

showsPrec :: Int -> Add a -> ShowS Source #

show :: Add a -> String Source #

showList :: [Add a] -> ShowS Source #

Additive a => Additive (Add a) Source # 
Instance details

Defined in ConCat.Additive

Methods

zero :: Add a Source #

(^+^) :: Add a -> Add a -> Add a Source #

HasRep (Add a) Source # 
Instance details

Defined in ConCat.Additive

Associated Types

type Rep (Add a) Source #

Methods

repr :: Add a -> Rep (Add a) Source #

abst :: Rep (Add a) -> Add a Source #

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

Defined in ConCat.Additive

Methods

(==) :: Add a -> Add a -> Bool Source #

(/=) :: Add a -> Add a -> Bool Source #

Ord a => Ord (Add a) Source # 
Instance details

Defined in ConCat.Additive

Methods

compare :: Add a -> Add a -> Ordering Source #

(<) :: Add a -> Add a -> Bool Source #

(<=) :: Add a -> Add a -> Bool Source #

(>) :: Add a -> Add a -> Bool Source #

(>=) :: Add a -> Add a -> Bool Source #

max :: Add a -> Add a -> Add a Source #

min :: Add a -> Add a -> Add a Source #

type Rep (Add a) Source # 
Instance details

Defined in ConCat.Additive

type Rep (Add a) = a

type SummableF h = (Representable h, Eq (Rep h), Zip h, Pointed h, Foldable h) Source #

class SummableF h => Summable h Source #

Instances

Instances details
SummableF h => Summable h Source # 
Instance details

Defined in ConCat.Additive

sumA :: (Foldable h, Additive a) => h a -> a Source #