halg-core-0.6.0.0: Core types and functions of halg computational algebra suite.
Safe HaskellNone
LanguageHaskell2010

Algebra.Instances

Description

This Library provides some *dangerous* instances for Doubles and Complex.

Orphan instances

Ring Double Source # 
Instance details

Rig Double Source # 
Instance details

DecidableZero Double Source # 
Instance details

Methods

isZero :: Double -> Bool #

Unital Double Source # 
Instance details

Methods

one :: Double #

pow :: Double -> Natural -> Double #

productWith :: Foldable f => (a -> Double) -> f a -> Double #

Division Double Source # 
Instance details

Methods

recip :: Double -> Double #

(/) :: Double -> Double -> Double #

(\\) :: Double -> Double -> Double #

(^) :: Integral n => Double -> n -> Double

Commutative Double Source # 
Instance details

Semiring Double Source # 
Instance details

Multiplicative Double Source # 
Instance details

Methods

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

pow1p :: Double -> Natural -> Double #

productWith1 :: Foldable1 f => (a -> Double) -> f a -> Double #

Monoidal Double Source # 
Instance details

Methods

zero :: Double #

sinnum :: Natural -> Double -> Double #

sumWith :: Foldable f => (a -> Double) -> f a -> Double #

Group Double Source # 
Instance details

Additive Double Source # 
Instance details

Methods

(+) :: Double -> Double -> Double #

sinnum1p :: Natural -> Double -> Double #

sumWith1 :: Foldable1 f => (a -> Double) -> f a -> Double #

Abelian Double Source # 
Instance details

RightModule Integer Double Source # 
Instance details

Methods

(*.) :: Double -> Integer -> Double #

RightModule Natural Double Source # 
Instance details

Methods

(*.) :: Double -> Natural -> Double #

LeftModule Integer Double Source # 
Instance details

Methods

(.*) :: Integer -> Double -> Double #

LeftModule Natural Double Source # 
Instance details

Methods

(.*) :: Natural -> Double -> Double #

Integral r => RightModule Integer (Ratio r) Source # 
Instance details

Methods

(*.) :: Ratio r -> Integer -> Ratio r #

Integral r => RightModule Natural (Ratio r) Source # 
Instance details

Methods

(*.) :: Ratio r -> Natural -> Ratio r #

RightModule a r => RightModule a (Complex r) Source # 
Instance details

Methods

(*.) :: Complex r -> a -> Complex r #

Integral r => LeftModule Integer (Ratio r) Source # 
Instance details

Methods

(.*) :: Integer -> Ratio r -> Ratio r #

Integral r => LeftModule Natural (Ratio r) Source # 
Instance details

Methods

(.*) :: Natural -> Ratio r -> Ratio r #

LeftModule a r => LeftModule a (Complex r) Source # 
Instance details

Methods

(.*) :: a -> Complex r -> Complex r #

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

Methods

fromInteger :: Integer -> Ratio r

Ring r => Ring (Complex r) Source # 
Instance details

Methods

fromInteger :: Integer -> Complex r

Integral r => Rig (Ratio r) Source # 
Instance details

Methods

fromNatural :: Natural -> Ratio r #

(Group r, Rig r) => Rig (Complex r) Source # 
Instance details

Methods

fromNatural :: Natural -> Complex r #

Integral r => DecidableZero (Ratio r) Source # 
Instance details

Methods

isZero :: Ratio r -> Bool #

DecidableZero r => DecidableZero (Complex r) Source #

These Instances are not algebraically right, but for the sake of convenience.

Instance details

Methods

isZero :: Complex r -> Bool #

Integral r => DecidableUnits (Ratio r) Source # 
Instance details

Methods

recipUnit :: Ratio r -> Maybe (Ratio r) #

isUnit :: Ratio r -> Bool #

(^?) :: Integral n => Ratio r -> n -> Maybe (Ratio r) #

Integral r => Unital (Ratio r) Source # 
Instance details

Methods

one :: Ratio r #

pow :: Ratio r -> Natural -> Ratio r #

productWith :: Foldable f => (a -> Ratio r) -> f a -> Ratio r #

(Group r, Monoidal r, Unital r) => Unital (Complex r) Source # 
Instance details

Methods

one :: Complex r #

pow :: Complex r -> Natural -> Complex r #

productWith :: Foldable f => (a -> Complex r) -> f a -> Complex r #

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

Methods

recip :: Ratio r -> Ratio r #

(/) :: Ratio r -> Ratio r -> Ratio r #

(\\) :: Ratio r -> Ratio r -> Ratio r #

(^) :: Integral n => Ratio r -> n -> Ratio r

Integral r => Commutative (Ratio r) Source # 
Instance details

(Group r, Commutative r) => Commutative (Complex r) Source # 
Instance details

Integral r => Semiring (Ratio r) Source # 
Instance details

(Group r, Semiring r) => Semiring (Complex r) Source # 
Instance details

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

Methods

(*) :: Ratio r -> Ratio r -> Ratio r #

pow1p :: Ratio r -> Natural -> Ratio r #

productWith1 :: Foldable1 f => (a -> Ratio r) -> f a -> Ratio r #

(Group r, Multiplicative r) => Multiplicative (Complex r) Source # 
Instance details

Methods

(*) :: Complex r -> Complex r -> Complex r #

pow1p :: Complex r -> Natural -> Complex r #

productWith1 :: Foldable1 f => (a -> Complex r) -> f a -> Complex r #

Integral r => Monoidal (Ratio r) Source # 
Instance details

Methods

zero :: Ratio r #

sinnum :: Natural -> Ratio r -> Ratio r #

sumWith :: Foldable f => (a -> Ratio r) -> f a -> Ratio r #

Monoidal r => Monoidal (Complex r) Source # 
Instance details

Methods

zero :: Complex r #

sinnum :: Natural -> Complex r -> Complex r #

sumWith :: Foldable f => (a -> Complex r) -> f a -> Complex r #

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

Methods

(-) :: Ratio r -> Ratio r -> Ratio r #

negate :: Ratio r -> Ratio r #

subtract :: Ratio r -> Ratio r -> Ratio r #

times :: Integral n => n -> Ratio r -> Ratio r #

Group r => Group (Complex r) Source # 
Instance details

Methods

(-) :: Complex r -> Complex r -> Complex r #

negate :: Complex r -> Complex r #

subtract :: Complex r -> Complex r -> Complex r #

times :: Integral n => n -> Complex r -> Complex r #

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

Methods

(+) :: Ratio r -> Ratio r -> Ratio r #

sinnum1p :: Natural -> Ratio r -> Ratio r #

sumWith1 :: Foldable1 f => (a -> Ratio r) -> f a -> Ratio r #

Additive r => Additive (Vector r) Source # 
Instance details

Methods

(+) :: Vector r -> Vector r -> Vector r #

sinnum1p :: Natural -> Vector r -> Vector r #

sumWith1 :: Foldable1 f => (a -> Vector r) -> f a -> Vector r #

Additive r => Additive (Complex r) Source # 
Instance details

Methods

(+) :: Complex r -> Complex r -> Complex r #

sinnum1p :: Natural -> Complex r -> Complex r #

sumWith1 :: Foldable1 f => (a -> Complex r) -> f a -> Complex r #

Integral r => Abelian (Ratio r) Source # 
Instance details

Abelian r => Abelian (Complex r) Source # 
Instance details

NFData a => NFData (Fraction a) Source # 
Instance details

Methods

rnf :: Fraction a -> () #

Random (Fraction Integer) Source # 
Instance details

Methods

randomR :: RandomGen g => (Fraction Integer, Fraction Integer) -> g -> (Fraction Integer, g)

random :: RandomGen g => g -> (Fraction Integer, g)

randomRs :: RandomGen g => (Fraction Integer, Fraction Integer) -> g -> [Fraction Integer]

randoms :: RandomGen g => g -> [Fraction Integer]

Convertible (Fraction Integer) Double Source # 
Instance details

Methods

safeConvert :: Fraction Integer -> ConvertResult Double

(Semiring r, Integral r) => RightModule (Scalar r) (Ratio r) Source # 
Instance details

Methods

(*.) :: Ratio r -> Scalar r -> Ratio r #

(Semiring r, Integral r) => LeftModule (Scalar r) (Ratio r) Source # 
Instance details

Methods

(.*) :: Scalar r -> Ratio r -> Ratio r #

Convertible (Fraction Integer) (Complex Double) Source # 
Instance details

Methods

safeConvert :: Fraction Integer -> ConvertResult (Complex Double)