NumericPrelude-0.0: An experimental alternative hierarchy of numeric type classesContentsIndex
Number.Physical
Portabilitygeneric instances
Stabilityprovisional
Maintainernumericprelude@henning-thielemann.de
Description
Numeric values combined with abstract Physical Units
Synopsis
data T i a = Cons (T i) a
quantity :: (Ord i, Enum i, C a) => [Int] -> a -> T i a
fromScalarSingle :: a -> T i a
isScalar :: T i a -> Bool
lift :: (a -> b) -> T i a -> T i b
lift2 :: Eq i => String -> (a -> b -> c) -> T i a -> T i b -> T i c
lift2Maybe :: Eq i => (a -> b -> c) -> T i a -> T i b -> Maybe (T i c)
lift2Gen :: Eq i => String -> (a -> b -> c) -> T i a -> T i b -> c
errorUnitMismatch :: String -> a
addMaybe :: (Eq i, C a) => T i a -> T i a -> Maybe (T i a)
subMaybe :: (Eq i, C a) => T i a -> T i a -> Maybe (T i a)
scale :: (Ord i, C a) => a -> T i a -> T i a
ratPow :: C a => T Int -> T i a -> T i a
ratPowMaybe :: C a => T Int -> T i a -> Maybe (T i a)
fromRatio :: (C b, ToInteger a) => T a -> b
Documentation
data T i a
A Physics.Quantity.Value.T combines a numeric value with a physical unit.
Constructors
Cons (T i) a
show/hide Instances
(Ord i, C a v) => C a (T i v)
(Ord i, C a v) => C a (T i v)
C a v => C a (T i v)
Ord i => C (T i)
Functor (T i)
Monad (T i)
C v => C (T a v)
(Ord i, C a) => C (T i a)
(Ord i, C a) => C (T i a)
(Ord i, C a) => C (T i a)
(Ord i, C a) => C (T i a)
(Ord i, C a) => C (T i a)
(Eq i, Eq a) => Eq (T i a)
(Ord i, Ord a) => Ord (T i a)
(Ord i, Real a) => Real (T i a)
(Ord i, Enum i, Show a) => Show (T i a)
quantity :: (Ord i, Enum i, C a) => [Int] -> a -> T i a
Construct a physical value from a numeric value and the full vector representation of a unit.
fromScalarSingle :: a -> T i a
isScalar :: T i a -> Bool
Test for the neutral Unit.T. Also a zero has a unit!
lift :: (a -> b) -> T i a -> T i b
apply a function to the numeric value while preserving the unit
lift2 :: Eq i => String -> (a -> b -> c) -> T i a -> T i b -> T i c
lift2Maybe :: Eq i => (a -> b -> c) -> T i a -> T i b -> Maybe (T i c)
lift2Gen :: Eq i => String -> (a -> b -> c) -> T i a -> T i b -> c
errorUnitMismatch :: String -> a
addMaybe :: (Eq i, C a) => T i a -> T i a -> Maybe (T i a)
Add two values if the units match, otherwise return Nothing
subMaybe :: (Eq i, C a) => T i a -> T i a -> Maybe (T i a)
Subtract two values if the units match, otherwise return Nothing
scale :: (Ord i, C a) => a -> T i a -> T i a
ratPow :: C a => T Int -> T i a -> T i a
ratPowMaybe :: C a => T Int -> T i a -> Maybe (T i a)
fromRatio :: (C b, ToInteger a) => T a -> b
Produced by Haddock version 0.7