HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulenumeric-prelude-0.4.4Haskell98

Number.Physical.UnitDatabase

Tools for creating a data base of physical units and for extracting data from it

  • 5 types
  • 19 values
datadata UnitSet i a
#

An entry for a unit and there scalings.

Constructors

Instances1Show
  • (Show i, Show a) => Show (UnitSet i a)Defined in numeric-prelude-0.4.4 · Number.Physical.UnitDatabase
valuepositiveToFront :: [UnitSet i a] -> [UnitSet i a]
#

Reorder the unit components in a way that the units with positive exponents lead the list.

valueevalDist
  1. :: (Ord i, C a)
  2. => T i
  3. -> T i a
  4. -> [(UnitSet i a, Int)]

    (UnitSet,distance) the UnitSet may contain powered units

#
valuefindMinExp :: [(Int, Int)] -> (Int, Int)
#

Find the exponent that lead to minimal distance Since the list is infinite maximum will fail but the sequence is convex and thus we can abort when the distance stop falling