gasp-1.2.0.0: A framework of algebraic classes

Safe HaskellSafe
LanguageHaskell2010

Algebra.Classes

Synopsis

Documentation

newtype Sum a Source #

Constructors

Sum 

Fields

Instances
Generic (Sum a) Source # 
Instance details

Defined in Algebra.Classes

Associated Types

type Rep (Sum a) :: Type -> Type #

Methods

from :: Sum a -> Rep (Sum a) x #

to :: Rep (Sum a) x -> Sum a #

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

Defined in Algebra.Classes

Methods

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

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

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

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

Defined in Algebra.Classes

Methods

mempty :: Sum a #

mappend :: Sum a -> Sum a -> Sum a #

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

Binary a => Binary (Sum a) Source # 
Instance details

Defined in Algebra.Classes

Methods

put :: Sum a -> Put #

get :: Get (Sum a) #

putList :: [Sum a] -> Put #

type Rep (Sum a) Source # 
Instance details

Defined in Algebra.Classes

type Rep (Sum a) = D1 (MetaData "Sum" "Algebra.Classes" "gasp-1.2.0.0-60xnh1c7HhuLy98Md0lIBW" True) (C1 (MetaCons "Sum" PrefixI True) (S1 (MetaSel (Just "fromSum") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))

newtype Product a Source #

Constructors

Product 

Fields

Instances
Multiplicative a => Semigroup (Product a) Source # 
Instance details

Defined in Algebra.Classes

Methods

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

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

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

Multiplicative a => Monoid (Product a) Source # 
Instance details

Defined in Algebra.Classes

Methods

mempty :: Product a #

mappend :: Product a -> Product a -> Product a #

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

newtype Exponential a Source #

Constructors

Exponential 

Fields

Instances
Group a => Division (Exponential a) Source # 
Instance details

Defined in Algebra.Classes

Additive a => Multiplicative (Exponential a) Source # 
Instance details

Defined in Algebra.Classes

class Additive a where Source #

Additive monoid

Minimal complete definition

(+), zero

Methods

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

zero :: a Source #

times :: Natural -> a -> a Source #

Instances
Additive Double Source # 
Instance details

Defined in Algebra.Classes

Additive Float Source # 
Instance details

Defined in Algebra.Classes

Additive Int Source # 
Instance details

Defined in Algebra.Classes

Methods

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

zero :: Int Source #

times :: Natural -> Int -> Int Source #

Additive Integer Source # 
Instance details

Defined in Algebra.Classes

Additive Word8 Source # 
Instance details

Defined in Algebra.Classes

Additive Word16 Source # 
Instance details

Defined in Algebra.Classes

Additive Word32 Source # 
Instance details

Defined in Algebra.Classes

Additive CInt Source # 
Instance details

Defined in Algebra.Classes

Additive InitialAdditive Source # 
Instance details

Defined in Algebra.Classes

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

Defined in Algebra.Classes

Methods

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

zero :: Ratio a Source #

times :: Natural -> Ratio a -> Ratio a Source #

(Ord k, Additive v) => Additive (Map k v) Source # 
Instance details

Defined in Algebra.Classes

Methods

(+) :: Map k v -> Map k v -> Map k v Source #

zero :: Map k v Source #

times :: Natural -> Map k v -> Map k v Source #

(Applicative f, Additive a) => Additive (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

(+) :: Euclid f a -> Euclid f a -> Euclid f a Source #

zero :: Euclid f a Source #

times :: Natural -> Euclid f a -> Euclid f a Source #

(Applicative f, Applicative g, Additive a) => Additive (Mat a f g) Source # 
Instance details

Defined in Algebra.Linear

Methods

(+) :: Mat a f g -> Mat a f g -> Mat a f g Source #

zero :: Mat a f g Source #

times :: Natural -> Mat a f g -> Mat a f g Source #

add :: (Foldable t, Additive a) => t a -> a Source #

class Additive r => DecidableZero r where Source #

Methods

isZero :: r -> Bool Source #

Instances
DecidableZero Double Source # 
Instance details

Defined in Algebra.Classes

Methods

isZero :: Double -> Bool Source #

DecidableZero Float Source # 
Instance details

Defined in Algebra.Classes

Methods

isZero :: Float -> Bool Source #

DecidableZero Int Source # 
Instance details

Defined in Algebra.Classes

Methods

isZero :: Int -> Bool Source #

DecidableZero Integer Source # 
Instance details

Defined in Algebra.Classes

Methods

isZero :: Integer -> Bool Source #

DecidableZero Word8 Source # 
Instance details

Defined in Algebra.Classes

Methods

isZero :: Word8 -> Bool Source #

DecidableZero Word16 Source # 
Instance details

Defined in Algebra.Classes

Methods

isZero :: Word16 -> Bool Source #

DecidableZero Word32 Source # 
Instance details

Defined in Algebra.Classes

Methods

isZero :: Word32 -> Bool Source #

DecidableZero CInt Source # 
Instance details

Defined in Algebra.Classes

Methods

isZero :: CInt -> Bool Source #

(Ord k, DecidableZero v) => DecidableZero (Map k v) Source # 
Instance details

Defined in Algebra.Classes

Methods

isZero :: Map k v -> Bool Source #

class Additive a => AbelianAdditive a Source #

Instances
AbelianAdditive Double Source # 
Instance details

Defined in Algebra.Classes

AbelianAdditive Float Source # 
Instance details

Defined in Algebra.Classes

AbelianAdditive Int Source # 
Instance details

Defined in Algebra.Classes

AbelianAdditive Integer Source # 
Instance details

Defined in Algebra.Classes

AbelianAdditive CInt Source # 
Instance details

Defined in Algebra.Classes

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

Defined in Algebra.Classes

(Ord k, AbelianAdditive v) => AbelianAdditive (Map k v) Source # 
Instance details

Defined in Algebra.Classes

(Applicative f, AbelianAdditive a) => AbelianAdditive (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

(Applicative f, Applicative g, AbelianAdditive a) => AbelianAdditive (Mat a f g) Source # 
Instance details

Defined in Algebra.Linear

class Additive a => Group a where Source #

Minimal complete definition

(negate | (-))

Methods

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

negate :: a -> a Source #

mult :: Integer -> a -> a Source #

Instances
Group Double Source # 
Instance details

Defined in Algebra.Classes

Group Float Source # 
Instance details

Defined in Algebra.Classes

Group Int Source # 
Instance details

Defined in Algebra.Classes

Methods

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

negate :: Int -> Int Source #

mult :: Integer -> Int -> Int Source #

Group Integer Source # 
Instance details

Defined in Algebra.Classes

Group Word8 Source # 
Instance details

Defined in Algebra.Classes

Group Word16 Source # 
Instance details

Defined in Algebra.Classes

Group Word32 Source # 
Instance details

Defined in Algebra.Classes

Group CInt Source # 
Instance details

Defined in Algebra.Classes

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

Defined in Algebra.Classes

Methods

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

negate :: Ratio a -> Ratio a Source #

mult :: Integer -> Ratio a -> Ratio a Source #

(Ord k, Group v) => Group (Map k v) Source # 
Instance details

Defined in Algebra.Classes

Methods

(-) :: Map k v -> Map k v -> Map k v Source #

negate :: Map k v -> Map k v Source #

mult :: Integer -> Map k v -> Map k v Source #

(Applicative f, Group a) => Group (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

(-) :: Euclid f a -> Euclid f a -> Euclid f a Source #

negate :: Euclid f a -> Euclid f a Source #

mult :: Integer -> Euclid f a -> Euclid f a Source #

(Applicative f, Applicative g, Group a) => Group (Mat a f g) Source # 
Instance details

Defined in Algebra.Linear

Methods

(-) :: Mat a f g -> Mat a f g -> Mat a f g Source #

negate :: Mat a f g -> Mat a f g Source #

mult :: Integer -> Mat a f g -> Mat a f g Source #

class (AbelianAdditive a, PreRing scalar) => Module scalar a where Source #

Module

Methods

(*^) :: scalar -> a -> a infixr 7 Source #

Instances
Module Double Double Source # 
Instance details

Defined in Algebra.Classes

Methods

(*^) :: Double -> Double -> Double Source #

Module Float Float Source # 
Instance details

Defined in Algebra.Classes

Methods

(*^) :: Float -> Float -> Float Source #

Module Int Int Source # 
Instance details

Defined in Algebra.Classes

Methods

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

Module Integer Integer Source # 
Instance details

Defined in Algebra.Classes

Module Rational Double Source # 
Instance details

Defined in Algebra.Classes

Methods

(*^) :: Rational -> Double -> Double Source #

Module CInt CInt Source # 
Instance details

Defined in Algebra.Classes

Methods

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

(Ord k, Module v v) => Module v (Map k v) Source # 
Instance details

Defined in Algebra.Classes

Methods

(*^) :: v -> Map k v -> Map k v Source #

(Applicative f, Module s a) => Module s (Euclid f a) Source # 
Instance details

Defined in Algebra.Linear

Methods

(*^) :: s -> Euclid f a -> Euclid f a Source #

(Applicative f, Applicative g, Module s a) => Module s (Mat a f g) Source # 
Instance details

Defined in Algebra.Linear

Methods

(*^) :: s -> Mat a f g -> Mat a f g Source #

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

Defined in Algebra.Classes

Methods

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

class Multiplicative a where Source #

Multiplicative monoid

Minimal complete definition

(*), one

Methods

(*) :: a -> a -> a infixl 7 Source #

one :: a Source #

(^) :: a -> Natural -> a Source #

Instances
Multiplicative Double Source # 
Instance details

Defined in Algebra.Classes

Multiplicative Float Source # 
Instance details

Defined in Algebra.Classes

Multiplicative Int Source # 
Instance details

Defined in Algebra.Classes

Methods

(*) :: Int -> Int -> Int Source #

one :: Int Source #

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

Multiplicative Integer Source # 
Instance details

Defined in Algebra.Classes

Multiplicative Word8 Source # 
Instance details

Defined in Algebra.Classes

Multiplicative Word16 Source # 
Instance details

Defined in Algebra.Classes

Multiplicative Word32 Source # 
Instance details

Defined in Algebra.Classes

Multiplicative CInt Source # 
Instance details

Defined in Algebra.Classes

Methods

(*) :: CInt -> CInt -> CInt Source #

one :: CInt Source #

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

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

Defined in Algebra.Classes

Methods

(*) :: Ratio a -> Ratio a -> Ratio a Source #

one :: Ratio a Source #

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

Additive a => Multiplicative (Exponential a) Source # 
Instance details

Defined in Algebra.Classes

(Ring s, Applicative v, Traversable v) => Multiplicative (OrthoMat v s) Source # 
Instance details

Defined in Algebra.Linear

Methods

(*) :: OrthoMat v s -> OrthoMat v s -> OrthoMat v s Source #

one :: OrthoMat v s Source #

(^) :: OrthoMat v s -> Natural -> OrthoMat v s Source #

multiply :: (Multiplicative a, Foldable f) => f a -> a Source #

type PreRing a = (SemiRing a, Group a) Source #

class (Module a a, PreRing a) => Ring a where Source #

Minimal complete definition

Nothing

Methods

fromInteger :: Integer -> a Source #

Instances
Ring Double Source # 
Instance details

Defined in Algebra.Classes

Ring Float Source # 
Instance details

Defined in Algebra.Classes

Ring Int Source # 
Instance details

Defined in Algebra.Classes

Ring Integer Source # 
Instance details

Defined in Algebra.Classes

Ring CInt Source # 
Instance details

Defined in Algebra.Classes

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

Defined in Algebra.Classes

class Multiplicative a => Division a where Source #

Minimal complete definition

(recip | (/))

Methods

recip :: a -> a Source #

(/) :: a -> a -> a infixl 7 Source #

Instances
Division Double Source # 
Instance details

Defined in Algebra.Classes

Division Float Source # 
Instance details

Defined in Algebra.Classes

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

Defined in Algebra.Classes

Methods

recip :: Ratio a -> Ratio a Source #

(/) :: Ratio a -> Ratio a -> Ratio a Source #

Group a => Division (Exponential a) Source # 
Instance details

Defined in Algebra.Classes

(Ring s, Applicative v, Traversable v) => Division (OrthoMat v s) Source # 
Instance details

Defined in Algebra.Linear

Methods

recip :: OrthoMat v s -> OrthoMat v s Source #

(/) :: OrthoMat v s -> OrthoMat v s -> OrthoMat v s Source #

class (Ring a, Division a) => Field a where Source #

Minimal complete definition

Nothing

Methods

fromRational :: Rational -> a Source #

Instances
Field Double Source # 
Instance details

Defined in Algebra.Classes

Field Float Source # 
Instance details

Defined in Algebra.Classes

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

Defined in Algebra.Classes

type VectorSpace scalar a = (Field scalar, Module scalar a) Source #

class Ring a => EuclideanDomain a where Source #

Minimal complete definition

(stdUnit | normalize), (divMod | div, mod)

Methods

stdAssociate :: a -> a Source #

stdUnit :: a -> a Source #

normalize :: a -> (a, a) Source #

div :: a -> a -> a infixl 7 Source #

mod :: a -> a -> a infixl 7 Source #

divMod :: a -> a -> (a, a) Source #

class (Real a, Enum a, EuclideanDomain a) => Integral a where Source #

Minimal complete definition

toInteger

Methods

quot :: a -> a -> a Source #

rem :: a -> a -> a Source #

quotRem :: a -> a -> (a, a) Source #

toInteger :: a -> Integer Source #

data Ratio a Source #

Constructors

!a :% !a 
Instances
Eq a => Eq (Ratio a) Source # 
Instance details

Defined in Algebra.Classes

Methods

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

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

gcd :: Integral a => a -> a -> a Source #

ifThenElse :: Bool -> t -> t -> t Source #