Safe Haskell | None |
---|---|
Language | Haskell98 |
Tools for creating a data base of physical units and for extracting data from it
- type T i a = [UnitSet i a]
- data InitUnitSet i a = InitUnitSet {
- initUnit :: T i
- initIndependent :: Bool
- initScales :: [InitScale a]
- data InitScale a = InitScale {
- initSymbol :: String
- initMag :: a
- initIsUnit :: Bool
- initDefault :: Bool
- data UnitSet i a = UnitSet {
- unit :: T i
- independent :: Bool
- defScaleIx :: Int
- reciprocal :: Bool
- scales :: [Scale a]
- data Scale a = Scale {}
- extractOne :: [a] -> a
- initScale :: String -> a -> Bool -> Bool -> InitScale a
- initUnitSet :: T i -> Bool -> [InitScale a] -> InitUnitSet i a
- createScale :: InitScale a -> Scale a
- createUnitSet :: InitUnitSet i a -> UnitSet i a
- showableUnit :: InitUnitSet i a -> Maybe (InitUnitSet i a)
- powerOfUnitSet :: (Ord i, C a) => Int -> UnitSet i a -> UnitSet i a
- powerOfScale :: C a => Int -> Scale a -> Scale a
- showExp :: Int -> String
- positiveToFront :: [UnitSet i a] -> [UnitSet i a]
- decompose :: (Ord i, C a) => T i -> T i a -> [UnitSet i a]
- findIndep :: Eq i => T i -> T i a -> Maybe (UnitSet i a)
- findClosest :: (Ord i, C a) => T i -> T i a -> UnitSet i a
- evalDist :: (Ord i, C a) => T i -> T i a -> [(UnitSet i a, Int)]
- findBestExp :: Ord i => T i -> T i -> (Int, Int)
- findMinExp :: [(Int, Int)] -> (Int, Int)
- distLE :: (Int, Int) -> (Int, Int) -> Bool
- distances :: Ord i => T i -> [(Int, T i)] -> [(Int, Int)]
- listMultiples :: (T i -> T i) -> Int -> [(Int, T i)]
Documentation
data InitUnitSet i a Source
InitUnitSet | |
|
InitScale | |
|
An entry for a unit and there scalings.
UnitSet | |
|
A common scaling for a unit.
extractOne :: [a] -> a Source
initUnitSet :: T i -> Bool -> [InitScale a] -> InitUnitSet i a Source
createScale :: InitScale a -> Scale a Source
createUnitSet :: InitUnitSet i a -> UnitSet i a Source
showableUnit :: InitUnitSet i a -> Maybe (InitUnitSet i a) Source
powerOfUnitSet :: (Ord i, C a) => Int -> UnitSet i a -> UnitSet i a Source
Raise all scales of a unit and the unit itself to the n-th power
positiveToFront :: [UnitSet i a] -> [UnitSet i a] Source
Reorder the unit components in a way that the units with positive exponents lead the list.
decompose :: (Ord i, C a) => T i -> T i a -> [UnitSet i a] Source
Decompose a complex unit into common ones