numeric-prelude-0.4.3: 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: 2.1 MethodsenumFrom :: Integer -> [Integer] #enumFromThen :: Integer -> Integer -> [Integer] #enumFromTo :: Integer -> Integer -> [Integer] #enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] # Methods(==) :: Integer -> Integer -> Bool #(/=) :: Integer -> Integer -> Bool # Since: 2.0.1 MethodsquotRem :: Integer -> Integer -> (Integer, Integer) #divMod :: Integer -> Integer -> (Integer, Integer) # Since: 2.1 Methods Methods(<) :: Integer -> Integer -> Bool #(<=) :: Integer -> Integer -> Bool #(>) :: Integer -> Integer -> Bool #(>=) :: Integer -> Integer -> Bool # Since: 2.1 Methods Since: 2.0.1 Methods Since: 2.1 MethodsshowList :: [Integer] -> ShowS # Since: 2.1 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 Methodslift :: Integer -> Q Exp # Methodsshrink :: Integer -> [Integer] # Methodscoarbitrary :: Integer -> Gen b -> Gen b # Methodsrnf :: Integer -> () # 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 # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # MethodsextendedGCD :: Integer -> Integer -> (Integer, (Integer, Integer)) Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # 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 # Methods Source # Methods Source # Methodsbasis :: Integer -> [Integer] Source #flatten :: Integer -> [Integer] Source # Source # Methods Source # Methods Source # Methods Source # Methods C a => C Integer (T a) Source # 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: 2.1 Methods Since: 2.1 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] # Methods(==) :: Int -> Int -> Bool #(/=) :: Int -> Int -> Bool # Since: 2.0.1 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: 2.1 Methods(+) :: Int -> Int -> Int #(-) :: Int -> Int -> Int #(*) :: Int -> Int -> Int #negate :: Int -> Int #abs :: Int -> Int #signum :: Int -> Int # 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: 2.1 Methods Since: 2.0.1 Methods Since: 2.1 MethodsshowsPrec :: Int -> Int -> ShowS #show :: Int -> String #showList :: [Int] -> ShowS # Since: 2.1 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 Methodslift :: Int -> Q Exp # Methodsshrink :: Int -> [Int] # Methodscoarbitrary :: Int -> Gen b -> Gen b # Since: 2.1 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 () # Methodsrnf :: Int -> () # 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 # Methods(+) :: Int -> Int -> Int Source #(-) :: Int -> Int -> Int Source # Source # Methods Source # Methods(*) :: Int -> Int -> Int Source #(^) :: Int -> Integer -> Int Source # Source # Methodsdiv :: Int -> Int -> Int Source #mod :: Int -> Int -> Int Source #divMod :: Int -> Int -> (Int, Int) Source # Source # Methods Source # MethodsextendedGCD :: Int -> Int -> (Int, (Int, Int)) Source #gcd :: Int -> Int -> Int Source #lcm :: Int -> Int -> Int Source # Source # Methodsabs :: Int -> Int Source # Source # Methods Source # Methodsquot :: Int -> Int -> Int Source #rem :: Int -> Int -> Int Source #quotRem :: Int -> Int -> (Int, Int) Source # Source # Methods Source # 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 # Methods(*>) :: Int -> Int -> Int Source # Source # Methodsbasis :: Int -> [Int] Source #flatten :: Int -> [Int] Source # Source # Methods Source # Methods Source # Methods Source # Methods Generic1 k (URec k Int) Associated Typestype Rep1 (URec k Int) (f :: URec k Int -> *) :: k -> * # Methodsfrom1 :: f a -> Rep1 (URec k Int) f a #to1 :: Rep1 (URec k Int) f a -> f a # Methodsfmap :: (a -> b) -> URec * Int a -> URec * Int b #(<$) :: a -> URec * Int b -> URec * Int a # 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 # 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 k Int p) Methods(==) :: URec k Int p -> URec k Int p -> Bool #(/=) :: URec k Int p -> URec k Int p -> Bool # Ord (URec k Int p) Methodscompare :: URec k Int p -> URec k Int p -> Ordering #(<) :: URec k Int p -> URec k Int p -> Bool #(<=) :: URec k Int p -> URec k Int p -> Bool #(>) :: URec k Int p -> URec k Int p -> Bool #(>=) :: URec k Int p -> URec k Int p -> Bool #max :: URec k Int p -> URec k Int p -> URec k Int p #min :: URec k Int p -> URec k Int p -> URec k Int p # Show (URec k Int p) MethodsshowsPrec :: Int -> URec k Int p -> ShowS #show :: URec k Int p -> String #showList :: [URec k Int p] -> ShowS # Generic (URec k Int p) Associated Typestype Rep (URec k Int p) :: * -> * # Methodsfrom :: URec k Int p -> Rep (URec k Int p) x #to :: Rep (URec k Int p) x -> URec k Int p # data URec k Int Used for marking occurrences of Int#Since: 4.9.0.0 data URec k Int = UInt {uInt# :: Int#} type Rep1 k (URec k Int) type Rep1 k (URec k Int) = D1 k (MetaData "URec" "GHC.Generics" "base" False) (C1 k (MetaCons "UInt" PrefixI True) (S1 k (MetaSel (Just Symbol "uInt#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UInt k))) type Rep (URec k Int p) type Rep (URec k Int p) = D1 * (MetaData "URec" "GHC.Generics" "base" False) (C1 * (MetaCons "UInt" PrefixI True) (S1 * (MetaSel (Just Symbol "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  Methods(==) :: Float -> Float -> Bool #(/=) :: Float -> Float -> Bool # Since: 2.1 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 # Methods(<) :: Float -> Float -> Bool #(<=) :: Float -> Float -> Bool #(>) :: Float -> Float -> Bool #(>=) :: Float -> Float -> Bool #max :: Float -> Float -> Float #min :: Float -> Float -> Float # Since: 2.1 Methods Since: 2.1 MethodsfloatRange :: Float -> (Int, Int) #decodeFloat :: Float -> (Integer, Int) #scaleFloat :: Int -> Float -> Float #isNaN :: Float -> Bool #isIEEE :: Float -> Bool #atan2 :: Float -> Float -> Float # Methodslift :: Float -> Q Exp # Methodsshrink :: Float -> [Float] # Methodscoarbitrary :: Float -> Gen b -> Gen b # Since: 2.1 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 () # Methodsrnf :: Float -> () # 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 # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # 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 # Source # Methods Source # Methodsrange :: Float -> (Int, Int) Source #decode :: Float -> (Integer, Int) Source # Source # Methods Source # Methods Source # Source # Methodsbasis :: Float -> [Float] Source #flatten :: Float -> [Float] Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Generic1 k (URec k Float) Associated Typestype Rep1 (URec k Float) (f :: URec k Float -> *) :: k -> * # Methodsfrom1 :: f a -> Rep1 (URec k Float) f a #to1 :: Rep1 (URec k Float) f a -> f a # Methodsfmap :: (a -> b) -> URec * Float a -> URec * Float b #(<$) :: a -> URec * Float b -> URec * Float a # 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 # 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 k Float p) Methods(==) :: URec k Float p -> URec k Float p -> Bool #(/=) :: URec k Float p -> URec k Float p -> Bool # Ord (URec k Float p) Methodscompare :: URec k Float p -> URec k Float p -> Ordering #(<) :: URec k Float p -> URec k Float p -> Bool #(<=) :: URec k Float p -> URec k Float p -> Bool #(>) :: URec k Float p -> URec k Float p -> Bool #(>=) :: URec k Float p -> URec k Float p -> Bool #max :: URec k Float p -> URec k Float p -> URec k Float p #min :: URec k Float p -> URec k Float p -> URec k Float p # Show (URec k Float p) MethodsshowsPrec :: Int -> URec k Float p -> ShowS #show :: URec k Float p -> String #showList :: [URec k Float p] -> ShowS # Generic (URec k Float p) Associated Typestype Rep (URec k Float p) :: * -> * # Methodsfrom :: URec k Float p -> Rep (URec k Float p) x #to :: Rep (URec k Float p) x -> URec k Float p # data URec k Float Used for marking occurrences of Float#Since: 4.9.0.0 data URec k Float = UFloat {uFloat# :: Float#} type Rep1 k (URec k Float) type Rep1 k (URec k Float) = D1 k (MetaData "URec" "GHC.Generics" "base" False) (C1 k (MetaCons "UFloat" PrefixI True) (S1 k (MetaSel (Just Symbol "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat k))) type Rep (URec k Float p) type Rep (URec k Float p) = D1 * (MetaData "URec" "GHC.Generics" "base" False) (C1 * (MetaCons "UFloat" PrefixI True) (S1 * (MetaSel (Just Symbol "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

 Methods(==) :: Double -> Double -> Bool #(/=) :: Double -> Double -> Bool # Since: 2.1 Methodsexp :: Double -> Double #log :: Double -> Double #(**) :: Double -> Double -> Double #sin :: Double -> Double #cos :: Double -> Double #tan :: Double -> Double # Methods(<) :: Double -> Double -> Bool #(<=) :: Double -> Double -> Bool #(>) :: Double -> Double -> Bool #(>=) :: Double -> Double -> Bool #max :: Double -> Double -> Double #min :: Double -> Double -> Double # Since: 2.1 Methods Since: 2.1 MethodsfloatRange :: Double -> (Int, Int) #decodeFloat :: Double -> (Integer, Int) #isNaN :: Double -> Bool #atan2 :: Double -> Double -> Double # Methodslift :: Double -> Q Exp # Methodsshrink :: Double -> [Double] # Methodscoarbitrary :: Double -> Gen b -> Gen b # Since: 2.1 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 () # Methodsrnf :: Double -> () # 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 # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Source # 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 # Source # Methods Source # Methodsrange :: Double -> (Int, Int) Source #decode :: Double -> (Integer, Int) Source # Source # Methods Source # Methods Source # Source # Methodsbasis :: Double -> [Double] Source #flatten :: Double -> [Double] Source # Source # Methods Source # Methods Source # Methods Source # Methods Source # Methods Generic1 k (URec k Double) Associated Typestype Rep1 (URec k Double) (f :: URec k Double -> *) :: k -> * # Methodsfrom1 :: f a -> Rep1 (URec k Double) f a #to1 :: Rep1 (URec k Double) f a -> f a # Methodsfmap :: (a -> b) -> URec * Double a -> URec * Double b #(<\$) :: a -> URec * Double b -> URec * Double a # 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 # 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 k Double p) Methods(==) :: URec k Double p -> URec k Double p -> Bool #(/=) :: URec k Double p -> URec k Double p -> Bool # Ord (URec k Double p) Methodscompare :: URec k Double p -> URec k Double p -> Ordering #(<) :: URec k Double p -> URec k Double p -> Bool #(<=) :: URec k Double p -> URec k Double p -> Bool #(>) :: URec k Double p -> URec k Double p -> Bool #(>=) :: URec k Double p -> URec k Double p -> Bool #max :: URec k Double p -> URec k Double p -> URec k Double p #min :: URec k Double p -> URec k Double p -> URec k Double p # Show (URec k Double p) MethodsshowsPrec :: Int -> URec k Double p -> ShowS #show :: URec k Double p -> String #showList :: [URec k Double p] -> ShowS # Associated Typestype Rep (URec k Double p) :: * -> * # Methodsfrom :: URec k Double p -> Rep (URec k Double p) x #to :: Rep (URec k Double p) x -> URec k Double p # data URec k Double Used for marking occurrences of Double#Since: 4.9.0.0 data URec k Double = UDouble {uDouble# :: Double#} type Rep1 k (URec k Double) type Rep1 k (URec k Double) = D1 k (MetaData "URec" "GHC.Generics" "base" False) (C1 k (MetaCons "UDouble" PrefixI True) (S1 k (MetaSel (Just Symbol "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble k))) type Rep (URec k Double p) type Rep (URec k Double p) = D1 * (MetaData "URec" "GHC.Generics" "base" False) (C1 * (MetaCons "UDouble" PrefixI True) (S1 * (MetaSel (Just Symbol "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble *)))

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

scale a vector by a scalar