numeric-prelude-0.4.3.1: An experimental alternative hierarchy of numeric type classes

NumericPrelude.Numeric

Synopsis

# Documentation

(+), (-) :: C a => a -> a -> a infixl 6 +, - Source #

(+), (-) :: C a => a -> a -> a infixl 6 +, - Source #

negate :: C a => a -> a Source #

inverse with respect to +

zero :: C a => a Source #

zero element of the vector space

subtract :: C a => a -> a -> a Source #

subtract is (-) with swapped operand order. This is the operand order which will be needed in most cases of partial application.

sum :: C a => [a] -> a Source #

Sum up all elements of a list. An empty list yields zero.

This function is inappropriate for number types like Peano. Maybe we should make sum a method of Additive. This would also make lengthLeft and lengthRight superfluous.

sum1 :: C a => [a] -> a Source #

Sum up all elements of a non-empty list. This avoids including a zero which is useful for types where no universal zero is available. ToDo: Should have NonEmpty type.

isZero :: C a => a -> Bool Source #

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

one :: C a => a Source #

(^) :: C a => a -> Integer -> a infixr 8 Source #

The exponent has fixed type Integer in order to avoid an arbitrarily limitted range of exponents, but to reduce the need for the compiler to guess the type (default type). In practice the exponent is most oftenly fixed, and is most oftenly 2. Fixed exponents can be optimized away and thus the expensive computation of Integers doesn't matter. The previous solution used a C constrained type and the exponent was converted to Integer before computation. So the current solution is not less efficient.

A variant of ^ with more flexibility is provided by ringPower.

ringPower :: (C a, C b) => b -> a -> a Source #

A prefix function of '(Algebra.Ring.^)' with a parameter order that fits the needs of partial application and function composition. It has generalised exponent.

See: Argument order of expNat on http://www.haskell.org/pipermail/haskell-cafe/2006-September/018022.html

sqr :: C a => a -> a Source #

product :: C a => [a] -> a Source #

product1 :: C a => [a] -> a Source #

div, mod :: C a => a -> a -> a infixl 7 div, mod Source #

div, mod :: C a => a -> a -> a infixl 7 div, mod Source #

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

divides :: (C a, C a) => a -> a -> Bool Source #

even :: (C a, C a) => a -> Bool Source #

odd :: (C a, C a) => a -> Bool Source #

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

recip :: C a => a -> a Source #

(^-) :: C a => a -> Integer -> a infixr 8 Source #

fieldPower :: (C a, C b) => b -> a -> a Source #

A prefix function of '(Algebra.Field.^-)'. It has a generalised exponent.

fromRational :: C a => Rational -> a Source #

Needed to work around shortcomings in GHC.

(^/) :: C a => a -> Rational -> a infixr 8 Source #

sqrt :: C a => a -> a Source #

pi :: C a => a Source #

exp, log :: C a => a -> a Source #

exp, log :: C a => a -> a Source #

logBase, (**) :: C a => a -> a -> a infixr 8 Source #

logBase, (**) :: C a => a -> a -> a infixr 8 Source #

(^?) :: C a => a -> a -> a infixr 8 Source #

sin, cos, tan :: C a => a -> a Source #

sin, cos, tan :: C a => a -> a Source #

sin, cos, tan :: C a => a -> a Source #

asin, acos, atan :: C a => a -> a Source #

asin, acos, atan :: C a => a -> a Source #

asin, acos, atan :: C a => a -> a Source #

sinh, cosh, tanh :: C a => a -> a Source #

sinh, cosh, tanh :: C a => a -> a Source #

sinh, cosh, tanh :: C a => a -> a Source #

asinh, acosh, atanh :: C a => a -> a Source #

asinh, acosh, atanh :: C a => a -> a Source #

asinh, acosh, atanh :: C a => a -> a Source #

abs :: C a => a -> a Source #

signum :: C a => a -> a Source #

quot, rem :: C a => a -> a -> a infixl 7 quot, rem Source #

quot, rem :: C a => a -> a -> a infixl 7 quot, rem Source #

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

splitFraction :: (C a, C b) => a -> (b, a) Source #

fraction :: C a => a -> a Source #

truncate :: (C a, C b) => a -> b Source #

round :: (C a, C b) => a -> b Source #

ceiling, floor :: (C a, C b) => a -> b Source #

ceiling, floor :: (C a, C b) => a -> b Source #

approxRational :: (C a, C a) => a -> a -> Rational Source #

TODO: Should be moved to a continued fraction module.

atan2 :: C a => a -> a -> a Source #

toRational :: C a => a -> Rational Source #

Lossless conversion from any representation of a rational to Rational

toInteger :: C a => a -> Integer Source #

fromIntegral :: (C a, C b) => a -> b Source #

isUnit :: C a => a -> Bool Source #

extendedGCD :: C a => a -> a -> (a, (a, a)) Source #

Compute the greatest common divisor and solve a respective Diophantine equation.

  (g,(a,b)) = extendedGCD x y ==>
g==a*x+b*y   &&  g == gcd x y

TODO: This method is not appropriate for the PID class, because there are rings like the one of the multivariate polynomials, where for all x and y greatest common divisors of x and y exist, but they cannot be represented as a linear combination of x and y. TODO: The definition of extendedGCD does not return the canonical associate.

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

The Greatest Common Divisor is defined by:

  gcd x y == gcd y x
divides z x && divides z y ==> divides z (gcd x y)   (specification)
divides (gcd x y) x

lcm :: C a => a -> a -> a Source #

Least common multiple

euclid :: (C a, C a) => (a -> a -> a) -> a -> a -> a Source #

extendedEuclid :: (C a, C a) => (a -> a -> (a, a)) -> a -> a -> (a, (a, a)) Source #

(%) :: C a => a -> a -> T a infixl 7 Source #

numerator :: T a -> a Source #

denominator :: T a -> a Source #

data Integer #

Invariant: Jn# and Jp# are used iff value doesn't fit in S#

Useful properties resulting from the invariants:

• abs (S# _) <= abs (Jp# _)
• abs (S# _) <  abs (Jn# _)
Instances
 Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsenumFrom :: Integer -> [Integer] #enumFromThen :: Integer -> Integer -> [Integer] #enumFromTo :: Integer -> Integer -> [Integer] #enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] # Instance detailsDefined in GHC.Integer.Type Methods(==) :: Integer -> Integer -> Bool #(/=) :: Integer -> Integer -> Bool # Since: base-2.0.1 Instance detailsDefined in GHC.Real MethodsquotRem :: Integer -> Integer -> (Integer, Integer) #divMod :: Integer -> Integer -> (Integer, Integer) # Since: base-2.1 Instance detailsDefined in GHC.Num Methods Instance detailsDefined in GHC.Integer.Type Methods(<) :: Integer -> Integer -> Bool #(<=) :: Integer -> Integer -> Bool #(>) :: Integer -> Integer -> Bool #(>=) :: Integer -> Integer -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.0.1 Instance detailsDefined in GHC.Real Methods Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowList :: [Integer] -> ShowS # Since: base-2.1 Instance detailsDefined in GHC.Arr Methodsrange :: (Integer, Integer) -> [Integer] #index :: (Integer, Integer) -> Integer -> Int #unsafeIndex :: (Integer, Integer) -> Integer -> IntinRange :: (Integer, Integer) -> Integer -> Bool #rangeSize :: (Integer, Integer) -> Int #unsafeRangeSize :: (Integer, Integer) -> Int Instance detailsDefined in Language.Haskell.TH.Syntax Methodslift :: Integer -> Q Exp # Instance detailsDefined in Test.QuickCheck.Arbitrary Methodsshrink :: Integer -> [Integer] # Instance detailsDefined in Test.QuickCheck.Arbitrary Methodscoarbitrary :: Integer -> Gen b -> Gen b # Instance detailsDefined in Control.DeepSeq Methodsrnf :: Integer -> () # Instance detailsDefined in System.Random MethodsrandomR :: RandomGen g => (Integer, Integer) -> g -> (Integer, g) #random :: RandomGen g => g -> (Integer, g) #randomRs :: RandomGen g => (Integer, Integer) -> g -> [Integer] #randoms :: RandomGen g => g -> [Integer] #randomRIO :: (Integer, Integer) -> IO Integer # Source # Instance detailsDefined in Algebra.Indexable Methods Source # Instance detailsDefined in Algebra.Additive Methods Source # Instance detailsDefined in Algebra.ZeroTestable Methods Source # Instance detailsDefined in Algebra.Ring Methods Source # Instance detailsDefined in Algebra.IntegralDomain Methods Source # Instance detailsDefined in Algebra.Units Methods Source # Instance detailsDefined in Algebra.PrincipalIdealDomain MethodsextendedGCD :: Integer -> Integer -> (Integer, (Integer, Integer)) Source # Source # Instance detailsDefined in Algebra.Absolute Methods Source # Instance detailsDefined in Algebra.ToRational Methods Source # Instance detailsDefined in Algebra.RealIntegral Methods Source # Instance detailsDefined in Algebra.ToInteger Methods Source # Instance detailsDefined in Algebra.RealRing MethodssplitFraction :: C b => Integer -> (b, Integer) Source #ceiling :: C b => Integer -> b Source #floor :: C b => Integer -> b Source #truncate :: C b => Integer -> b Source #round :: C b => Integer -> b Source # Source # Instance detailsDefined in Algebra.Lattice Methods Source # Instance detailsDefined in Algebra.Module Methods Source # Instance detailsDefined in Algebra.ModuleBasis Methodsbasis :: Integer -> [Integer] Source #flatten :: Integer -> [Integer] Source # Source # Instance detailsDefined in Algebra.NormedSpace.Sum Methods Source # Instance detailsDefined in Algebra.NormedSpace.Maximum Methods Source # Instance detailsDefined in Algebra.NormedSpace.Euclidean Methods Source # Instance detailsDefined in Algebra.NormedSpace.Euclidean Methods C a => C Integer (T a) Source # Instance detailsDefined in Algebra.Module Methods(*>) :: Integer -> T a -> T a Source #

data Int #

A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]. The exact range for a given implementation can be determined by using minBound and maxBound from the Bounded class.

Instances
 Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methodssucc :: Int -> Int #pred :: Int -> Int #toEnum :: Int -> Int #fromEnum :: Int -> Int #enumFrom :: Int -> [Int] #enumFromThen :: Int -> Int -> [Int] #enumFromTo :: Int -> Int -> [Int] #enumFromThenTo :: Int -> Int -> Int -> [Int] # Instance detailsDefined in GHC.Classes Methods(==) :: Int -> Int -> Bool #(/=) :: Int -> Int -> Bool # Since: base-2.0.1 Instance detailsDefined in GHC.Real Methodsquot :: Int -> Int -> Int #rem :: Int -> Int -> Int #div :: Int -> Int -> Int #mod :: Int -> Int -> Int #quotRem :: Int -> Int -> (Int, Int) #divMod :: Int -> Int -> (Int, Int) # Since: base-2.1 Instance detailsDefined in GHC.Num Methods(+) :: Int -> Int -> Int #(-) :: Int -> Int -> Int #(*) :: Int -> Int -> Int #negate :: Int -> Int #abs :: Int -> Int #signum :: Int -> Int # Instance detailsDefined in GHC.Classes Methodscompare :: Int -> Int -> Ordering #(<) :: Int -> Int -> Bool #(<=) :: Int -> Int -> Bool #(>) :: Int -> Int -> Bool #(>=) :: Int -> Int -> Bool #max :: Int -> Int -> Int #min :: Int -> Int -> Int # Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.0.1 Instance detailsDefined in GHC.Real Methods Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowsPrec :: Int -> Int -> ShowS #show :: Int -> String #showList :: [Int] -> ShowS # Since: base-2.1 Instance detailsDefined in GHC.Arr Methodsrange :: (Int, Int) -> [Int] #index :: (Int, Int) -> Int -> Int #unsafeIndex :: (Int, Int) -> Int -> IntinRange :: (Int, Int) -> Int -> Bool #rangeSize :: (Int, Int) -> Int #unsafeRangeSize :: (Int, Int) -> Int Instance detailsDefined in Language.Haskell.TH.Syntax Methodslift :: Int -> Q Exp # Instance detailsDefined in Test.QuickCheck.Arbitrary Methodsshrink :: Int -> [Int] # Instance detailsDefined in Test.QuickCheck.Arbitrary Methodscoarbitrary :: Int -> Gen b -> Gen b # Since: base-2.1 Instance detailsDefined in Foreign.Storable MethodssizeOf :: Int -> Int #alignment :: Int -> Int #pokeElemOff :: Ptr Int -> Int -> Int -> IO () #peekByteOff :: Ptr b -> Int -> IO Int #pokeByteOff :: Ptr b -> Int -> Int -> IO () #peek :: Ptr Int -> IO Int #poke :: Ptr Int -> Int -> IO () # Instance detailsDefined in Control.DeepSeq Methodsrnf :: Int -> () # Instance detailsDefined in System.Random MethodsrandomR :: RandomGen g => (Int, Int) -> g -> (Int, g) #random :: RandomGen g => g -> (Int, g) #randomRs :: RandomGen g => (Int, Int) -> g -> [Int] #randoms :: RandomGen g => g -> [Int] #randomRIO :: (Int, Int) -> IO Int # Source # Instance detailsDefined in Algebra.Additive Methods(+) :: Int -> Int -> Int Source #(-) :: Int -> Int -> Int Source # Source # Instance detailsDefined in Algebra.ZeroTestable Methods Source # Instance detailsDefined in Algebra.Ring Methods(*) :: Int -> Int -> Int Source #(^) :: Int -> Integer -> Int Source # Source # Instance detailsDefined in Algebra.IntegralDomain Methodsdiv :: Int -> Int -> Int Source #mod :: Int -> Int -> Int Source #divMod :: Int -> Int -> (Int, Int) Source # Source # Instance detailsDefined in Algebra.Units Methods Source # Instance detailsDefined in Algebra.PrincipalIdealDomain MethodsextendedGCD :: Int -> Int -> (Int, (Int, Int)) Source #gcd :: Int -> Int -> Int Source #lcm :: Int -> Int -> Int Source # Source # Instance detailsDefined in Algebra.Absolute Methodsabs :: Int -> Int Source # Source # Instance detailsDefined in Algebra.ToRational Methods Source # Instance detailsDefined in Algebra.RealIntegral Methodsquot :: Int -> Int -> Int Source #rem :: Int -> Int -> Int Source #quotRem :: Int -> Int -> (Int, Int) Source # Source # Instance detailsDefined in Algebra.ToInteger Methods Source # Instance detailsDefined in Algebra.RealRing MethodssplitFraction :: C b => Int -> (b, Int) Source #ceiling :: C b => Int -> b Source #floor :: C b => Int -> b Source #truncate :: C b => Int -> b Source #round :: C b => Int -> b Source # Source # Instance detailsDefined in Algebra.Module Methods(*>) :: Int -> Int -> Int Source # Source # Instance detailsDefined in Algebra.ModuleBasis Methodsbasis :: Int -> [Int] Source #flatten :: Int -> [Int] Source # Source # Instance detailsDefined in Algebra.NormedSpace.Sum Methods Source # Instance detailsDefined in Algebra.NormedSpace.Maximum Methods Source # Instance detailsDefined in Algebra.NormedSpace.Euclidean Methods Source # Instance detailsDefined in Algebra.NormedSpace.Euclidean Methods Generic1 (URec Int :: k -> *) Instance detailsDefined in GHC.Generics Associated Typestype Rep1 (URec Int) :: k -> * # Methodsfrom1 :: URec Int a -> Rep1 (URec Int) a #to1 :: Rep1 (URec Int) a -> URec Int a # Functor (URec Int :: * -> *) Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec Int a -> URec Int b #(<$) :: a -> URec Int b -> URec Int a # Foldable (URec Int :: * -> *) Instance detailsDefined in Data.Foldable Methodsfold :: Monoid m => URec Int m -> m #foldMap :: Monoid m => (a -> m) -> URec Int a -> m #foldr :: (a -> b -> b) -> b -> URec Int a -> b #foldr' :: (a -> b -> b) -> b -> URec Int a -> b #foldl :: (b -> a -> b) -> b -> URec Int a -> b #foldl' :: (b -> a -> b) -> b -> URec Int a -> b #foldr1 :: (a -> a -> a) -> URec Int a -> a #foldl1 :: (a -> a -> a) -> URec Int a -> a #toList :: URec Int a -> [a] #null :: URec Int a -> Bool #length :: URec Int a -> Int #elem :: Eq a => a -> URec Int a -> Bool #maximum :: Ord a => URec Int a -> a #minimum :: Ord a => URec Int a -> a #sum :: Num a => URec Int a -> a #product :: Num a => URec Int a -> a # Traversable (URec Int :: * -> *) Instance detailsDefined in Data.Traversable Methodstraverse :: Applicative f => (a -> f b) -> URec Int a -> f (URec Int b) #sequenceA :: Applicative f => URec Int (f a) -> f (URec Int a) #mapM :: Monad m => (a -> m b) -> URec Int a -> m (URec Int b) #sequence :: Monad m => URec Int (m a) -> m (URec Int a) # Eq (URec Int p) Instance detailsDefined in GHC.Generics Methods(==) :: URec Int p -> URec Int p -> Bool #(/=) :: URec Int p -> URec Int p -> Bool # Ord (URec Int p) Instance detailsDefined in GHC.Generics Methodscompare :: URec Int p -> URec Int p -> Ordering #(<) :: URec Int p -> URec Int p -> Bool #(<=) :: URec Int p -> URec Int p -> Bool #(>) :: URec Int p -> URec Int p -> Bool #(>=) :: URec Int p -> URec Int p -> Bool #max :: URec Int p -> URec Int p -> URec Int p #min :: URec Int p -> URec Int p -> URec Int p # Show (URec Int p) Instance detailsDefined in GHC.Generics MethodsshowsPrec :: Int -> URec Int p -> ShowS #show :: URec Int p -> String #showList :: [URec Int p] -> ShowS # Instance detailsDefined in GHC.Generics Associated Typestype Rep (URec Int p) :: * -> * # Methodsfrom :: URec Int p -> Rep (URec Int p) x #to :: Rep (URec Int p) x -> URec Int p # data URec Int (p :: k) Used for marking occurrences of Int#Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics data URec Int (p :: k) = UInt {uInt# :: Int#} type Rep1 (URec Int :: k -> *) Instance detailsDefined in GHC.Generics type Rep1 (URec Int :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UInt" PrefixI True) (S1 (MetaSel (Just "uInt#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UInt :: k -> *))) type Rep (URec Int p) Instance detailsDefined in GHC.Generics type Rep (URec Int p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UInt" PrefixI True) (S1 (MetaSel (Just "uInt#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UInt :: * -> *))) data Float # Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type. Instances  Instance detailsDefined in GHC.Classes Methods(==) :: Float -> Float -> Bool #(/=) :: Float -> Float -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Float Methodspi :: Float #exp :: Float -> Float #log :: Float -> Float #sqrt :: Float -> Float #(**) :: Float -> Float -> Float #logBase :: Float -> Float -> Float #sin :: Float -> Float #cos :: Float -> Float #tan :: Float -> Float #asin :: Float -> Float #acos :: Float -> Float #atan :: Float -> Float #sinh :: Float -> Float #cosh :: Float -> Float #tanh :: Float -> Float #asinh :: Float -> Float #acosh :: Float -> Float #atanh :: Float -> Float #log1p :: Float -> Float #expm1 :: Float -> Float # Instance detailsDefined in GHC.Classes Methods(<) :: Float -> Float -> Bool #(<=) :: Float -> Float -> Bool #(>) :: Float -> Float -> Bool #(>=) :: Float -> Float -> Bool #max :: Float -> Float -> Float #min :: Float -> Float -> Float # Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Float MethodsfloatRange :: Float -> (Int, Int) #decodeFloat :: Float -> (Integer, Int) #scaleFloat :: Int -> Float -> Float #isNaN :: Float -> Bool #isIEEE :: Float -> Bool #atan2 :: Float -> Float -> Float # Instance detailsDefined in Language.Haskell.TH.Syntax Methodslift :: Float -> Q Exp # Instance detailsDefined in Test.QuickCheck.Arbitrary Methodsshrink :: Float -> [Float] # Instance detailsDefined in Test.QuickCheck.Arbitrary Methodscoarbitrary :: Float -> Gen b -> Gen b # Since: base-2.1 Instance detailsDefined in Foreign.Storable MethodssizeOf :: Float -> Int #pokeElemOff :: Ptr Float -> Int -> Float -> IO () #peekByteOff :: Ptr b -> Int -> IO Float #pokeByteOff :: Ptr b -> Int -> Float -> IO () #poke :: Ptr Float -> Float -> IO () # Instance detailsDefined in Control.DeepSeq Methodsrnf :: Float -> () # Instance detailsDefined in System.Random MethodsrandomR :: RandomGen g => (Float, Float) -> g -> (Float, g) #random :: RandomGen g => g -> (Float, g) #randomRs :: RandomGen g => (Float, Float) -> g -> [Float] #randoms :: RandomGen g => g -> [Float] #randomRIO :: (Float, Float) -> IO Float # Source # Instance detailsDefined in Algebra.Additive Methods Source # Instance detailsDefined in Algebra.ZeroTestable Methods Source # Instance detailsDefined in Algebra.Ring Methods Source # Instance detailsDefined in Algebra.Absolute Methods Source # Instance detailsDefined in Algebra.Field Methods Source # Instance detailsDefined in Algebra.ToRational Methods Source # Instance detailsDefined in Algebra.Algebraic Methods Source # Instance detailsDefined in Algebra.Transcendental Methods Source # Instance detailsDefined in Algebra.RealRing MethodssplitFraction :: C b => Float -> (b, Float) Source #ceiling :: C b => Float -> b Source #floor :: C b => Float -> b Source #truncate :: C b => Float -> b Source #round :: C b => Float -> b Source # Source # Instance detailsDefined in Algebra.RealField Source # Instance detailsDefined in Algebra.RealTranscendental Methods Source # Instance detailsDefined in Algebra.FloatingPoint Methodsrange :: Float -> (Int, Int) Source #decode :: Float -> (Integer, Int) Source # Source # Instance detailsDefined in Number.Complex Methods Source # Instance detailsDefined in Algebra.Module Methods Source # Instance detailsDefined in Algebra.VectorSpace Source # Instance detailsDefined in Algebra.ModuleBasis Methodsbasis :: Float -> [Float] Source #flatten :: Float -> [Float] Source # Source # Instance detailsDefined in Algebra.OccasionallyScalar Methods Source # Instance detailsDefined in Algebra.NormedSpace.Sum Methods Source # Instance detailsDefined in Algebra.NormedSpace.Maximum Methods Source # Instance detailsDefined in Algebra.NormedSpace.Euclidean Methods Source # Instance detailsDefined in Algebra.NormedSpace.Euclidean Methods Generic1 (URec Float :: k -> *) Instance detailsDefined in GHC.Generics Associated Typestype Rep1 (URec Float) :: k -> * # Methodsfrom1 :: URec Float a -> Rep1 (URec Float) a #to1 :: Rep1 (URec Float) a -> URec Float a # Functor (URec Float :: * -> *) Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec Float a -> URec Float b #(<$) :: a -> URec Float b -> URec Float a # Foldable (URec Float :: * -> *) Instance detailsDefined in Data.Foldable Methodsfold :: Monoid m => URec Float m -> m #foldMap :: Monoid m => (a -> m) -> URec Float a -> m #foldr :: (a -> b -> b) -> b -> URec Float a -> b #foldr' :: (a -> b -> b) -> b -> URec Float a -> b #foldl :: (b -> a -> b) -> b -> URec Float a -> b #foldl' :: (b -> a -> b) -> b -> URec Float a -> b #foldr1 :: (a -> a -> a) -> URec Float a -> a #foldl1 :: (a -> a -> a) -> URec Float a -> a #toList :: URec Float a -> [a] #null :: URec Float a -> Bool #length :: URec Float a -> Int #elem :: Eq a => a -> URec Float a -> Bool #maximum :: Ord a => URec Float a -> a #minimum :: Ord a => URec Float a -> a #sum :: Num a => URec Float a -> a #product :: Num a => URec Float a -> a # Traversable (URec Float :: * -> *) Instance detailsDefined in Data.Traversable Methodstraverse :: Applicative f => (a -> f b) -> URec Float a -> f (URec Float b) #sequenceA :: Applicative f => URec Float (f a) -> f (URec Float a) #mapM :: Monad m => (a -> m b) -> URec Float a -> m (URec Float b) #sequence :: Monad m => URec Float (m a) -> m (URec Float a) # Eq (URec Float p) Instance detailsDefined in GHC.Generics Methods(==) :: URec Float p -> URec Float p -> Bool #(/=) :: URec Float p -> URec Float p -> Bool # Ord (URec Float p) Instance detailsDefined in GHC.Generics Methodscompare :: URec Float p -> URec Float p -> Ordering #(<) :: URec Float p -> URec Float p -> Bool #(<=) :: URec Float p -> URec Float p -> Bool #(>) :: URec Float p -> URec Float p -> Bool #(>=) :: URec Float p -> URec Float p -> Bool #max :: URec Float p -> URec Float p -> URec Float p #min :: URec Float p -> URec Float p -> URec Float p # Instance detailsDefined in GHC.Generics MethodsshowsPrec :: Int -> URec Float p -> ShowS #show :: URec Float p -> String #showList :: [URec Float p] -> ShowS # Instance detailsDefined in GHC.Generics Associated Typestype Rep (URec Float p) :: * -> * # Methodsfrom :: URec Float p -> Rep (URec Float p) x #to :: Rep (URec Float p) x -> URec Float p # data URec Float (p :: k) Used for marking occurrences of Float#Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics data URec Float (p :: k) = UFloat {uFloat# :: Float#} type Rep1 (URec Float :: k -> *) Instance detailsDefined in GHC.Generics type Rep1 (URec Float :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UFloat" PrefixI True) (S1 (MetaSel (Just "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat :: k -> *))) type Rep (URec Float p) Instance detailsDefined in GHC.Generics type Rep (URec Float p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UFloat" PrefixI True) (S1 (MetaSel (Just "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat :: * -> *)))

data Double #

Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.

Instances
 Instance detailsDefined in GHC.Classes Methods(==) :: Double -> Double -> Bool #(/=) :: Double -> Double -> Bool # Since: base-2.1 Instance detailsDefined in GHC.Float Methodsexp :: Double -> Double #log :: Double -> Double #(**) :: Double -> Double -> Double #sin :: Double -> Double #cos :: Double -> Double #tan :: Double -> Double # Instance detailsDefined in GHC.Classes Methods(<) :: Double -> Double -> Bool #(<=) :: Double -> Double -> Bool #(>) :: Double -> Double -> Bool #(>=) :: Double -> Double -> Bool #max :: Double -> Double -> Double #min :: Double -> Double -> Double # Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Float MethodsfloatRange :: Double -> (Int, Int) #decodeFloat :: Double -> (Integer, Int) #isNaN :: Double -> Bool #atan2 :: Double -> Double -> Double # Instance detailsDefined in Language.Haskell.TH.Syntax Methodslift :: Double -> Q Exp # Instance detailsDefined in Test.QuickCheck.Arbitrary Methodsshrink :: Double -> [Double] # Instance detailsDefined in Test.QuickCheck.Arbitrary Methodscoarbitrary :: Double -> Gen b -> Gen b # Since: base-2.1 Instance detailsDefined in Foreign.Storable MethodssizeOf :: Double -> Int #pokeElemOff :: Ptr Double -> Int -> Double -> IO () #peekByteOff :: Ptr b -> Int -> IO Double #pokeByteOff :: Ptr b -> Int -> Double -> IO () #poke :: Ptr Double -> Double -> IO () # Instance detailsDefined in Control.DeepSeq Methodsrnf :: Double -> () # Instance detailsDefined in System.Random MethodsrandomR :: RandomGen g => (Double, Double) -> g -> (Double, g) #random :: RandomGen g => g -> (Double, g) #randomRs :: RandomGen g => (Double, Double) -> g -> [Double] #randoms :: RandomGen g => g -> [Double] #randomRIO :: (Double, Double) -> IO Double # Source # Instance detailsDefined in Algebra.Additive Methods Source # Instance detailsDefined in Algebra.ZeroTestable Methods Source # Instance detailsDefined in Algebra.Ring Methods Source # Instance detailsDefined in Algebra.Absolute Methods Source # Instance detailsDefined in Algebra.Field Methods Source # Instance detailsDefined in Algebra.ToRational Methods Source # Instance detailsDefined in Algebra.Algebraic Methods Source # Instance detailsDefined in Algebra.Transcendental Methods Source # Instance detailsDefined in Algebra.RealRing MethodssplitFraction :: C b => Double -> (b, Double) Source #ceiling :: C b => Double -> b Source #floor :: C b => Double -> b Source #truncate :: C b => Double -> b Source #round :: C b => Double -> b Source # Source # Instance detailsDefined in Algebra.RealField Source # Instance detailsDefined in Algebra.RealTranscendental Methods Source # Instance detailsDefined in Algebra.FloatingPoint Methodsrange :: Double -> (Int, Int) Source #decode :: Double -> (Integer, Int) Source # Source # Instance detailsDefined in Number.Complex Methods Source # Instance detailsDefined in Algebra.Module Methods Source # Instance detailsDefined in Algebra.VectorSpace Source # Instance detailsDefined in Algebra.ModuleBasis Methodsbasis :: Double -> [Double] Source #flatten :: Double -> [Double] Source # Source # Instance detailsDefined in Algebra.OccasionallyScalar Methods Source # Instance detailsDefined in Algebra.NormedSpace.Sum Methods Source # Instance detailsDefined in Algebra.NormedSpace.Maximum Methods Source # Instance detailsDefined in Algebra.NormedSpace.Euclidean Methods Source # Instance detailsDefined in Algebra.NormedSpace.Euclidean Methods Generic1 (URec Double :: k -> *) Instance detailsDefined in GHC.Generics Associated Typestype Rep1 (URec Double) :: k -> * # Methodsfrom1 :: URec Double a -> Rep1 (URec Double) a #to1 :: Rep1 (URec Double) a -> URec Double a # Functor (URec Double :: * -> *) Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec Double a -> URec Double b #(<\$) :: a -> URec Double b -> URec Double a # Foldable (URec Double :: * -> *) Instance detailsDefined in Data.Foldable Methodsfold :: Monoid m => URec Double m -> m #foldMap :: Monoid m => (a -> m) -> URec Double a -> m #foldr :: (a -> b -> b) -> b -> URec Double a -> b #foldr' :: (a -> b -> b) -> b -> URec Double a -> b #foldl :: (b -> a -> b) -> b -> URec Double a -> b #foldl' :: (b -> a -> b) -> b -> URec Double a -> b #foldr1 :: (a -> a -> a) -> URec Double a -> a #foldl1 :: (a -> a -> a) -> URec Double a -> a #toList :: URec Double a -> [a] #null :: URec Double a -> Bool #length :: URec Double a -> Int #elem :: Eq a => a -> URec Double a -> Bool #maximum :: Ord a => URec Double a -> a #minimum :: Ord a => URec Double a -> a #sum :: Num a => URec Double a -> a #product :: Num a => URec Double a -> a # Traversable (URec Double :: * -> *) Instance detailsDefined in Data.Traversable Methodstraverse :: Applicative f => (a -> f b) -> URec Double a -> f (URec Double b) #sequenceA :: Applicative f => URec Double (f a) -> f (URec Double a) #mapM :: Monad m => (a -> m b) -> URec Double a -> m (URec Double b) #sequence :: Monad m => URec Double (m a) -> m (URec Double a) # Eq (URec Double p) Instance detailsDefined in GHC.Generics Methods(==) :: URec Double p -> URec Double p -> Bool #(/=) :: URec Double p -> URec Double p -> Bool # Instance detailsDefined in GHC.Generics Methodscompare :: URec Double p -> URec Double p -> Ordering #(<) :: URec Double p -> URec Double p -> Bool #(<=) :: URec Double p -> URec Double p -> Bool #(>) :: URec Double p -> URec Double p -> Bool #(>=) :: URec Double p -> URec Double p -> Bool #max :: URec Double p -> URec Double p -> URec Double p #min :: URec Double p -> URec Double p -> URec Double p # Instance detailsDefined in GHC.Generics MethodsshowsPrec :: Int -> URec Double p -> ShowS #show :: URec Double p -> String #showList :: [URec Double p] -> ShowS # Instance detailsDefined in GHC.Generics Associated Typestype Rep (URec Double p) :: * -> * # Methodsfrom :: URec Double p -> Rep (URec Double p) x #to :: Rep (URec Double p) x -> URec Double p # data URec Double (p :: k) Used for marking occurrences of Double#Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics data URec Double (p :: k) = UDouble {uDouble# :: Double#} type Rep1 (URec Double :: k -> *) Instance detailsDefined in GHC.Generics type Rep1 (URec Double :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UDouble" PrefixI True) (S1 (MetaSel (Just "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble :: k -> *))) type Rep (URec Double p) Instance detailsDefined in GHC.Generics type Rep (URec Double p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UDouble" PrefixI True) (S1 (MetaSel (Just "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble :: * -> *)))

(*>) :: C a v => a -> v -> v infixr 7 Source #

scale a vector by a scalar