Copyright | (C) 2013 Richard Eisenberg |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Richard Eisenberg (rae@cs.brynmawr.edu) |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
This module exports unit definitions according to the SI system of units. The definitions were taken from here: http://www.bipm.org/en/si/.
Some additional units were added based on this link: "Non-SI units accepted for use with the SI, and units based on fundamental constants".
There is one deviation from the definitions at that site: To work better
with prefixes, the unit of mass is Gram
.
This module exports both American spellings and British spellings of units, using pattern synonyms to get the British spellings of data constructors.
Synopsis
- data Meter = Meter
- type Metre = Meter
- pattern Metre :: Meter
- data Gram = Gram
- type Gramme = Gram
- pattern Gramme :: Gramme
- data Second = Second
- data Minute = Minute
- data Hour = Hour
- data Ampere = Ampere
- data Kelvin = Kelvin
- data Mole = Mole
- data Candela = Candela
- data Radian = Radian
- data Steradian = Steradian
- data Hertz = Hertz
- data Liter = Liter
- type Litre = Liter
- pattern Litre :: Litre
- data Newton = Newton
- data Pascal = Pascal
- data Joule = Joule
- data Watt = Watt
- data Coulomb = Coulomb
- data Volt = Volt
- data Farad = Farad
- data Ohm = Ohm
- data Siemens = Siemens
- data Weber = Weber
- data Tesla = Tesla
- data Henry = Henry
- data Lumen = Lumen
- data Lux = Lux
- data Becquerel = Becquerel
- data Gray = Gray
- data Sievert = Sievert
- data Katal = Katal
- data Degree = Degree
- data Arcminute = Arcminute
- data Arcsecond = Arcsecond
- data Hectare = Hectare
- data Ton = Ton
- type Tonne = Ton
- pattern Tonne :: Tonne
- siUnits :: [Name]
Documentation
Instances
Show Meter Source # | |
Unit Meter Source # | |
Defined in Data.Units.SI conversionRatio :: Meter -> Rational # canonicalConvRatio :: Meter -> Rational | |
type UnitFactorsOf Meter Source # | |
Defined in Data.Units.SI | |
type DimOfUnit Meter Source # | |
Defined in Data.Units.SI | |
type BaseUnit Meter Source # | |
Defined in Data.Units.SI |
Instances
Show Gram Source # | |
Unit Gram Source # | |
Defined in Data.Units.SI conversionRatio :: Gram -> Rational # canonicalConvRatio :: Gram -> Rational | |
type UnitFactorsOf Gram Source # | |
Defined in Data.Units.SI | |
type DimOfUnit Gram Source # | |
Defined in Data.Units.SI | |
type BaseUnit Gram Source # | |
Defined in Data.Units.SI |
Instances
Show Second Source # | |
Unit Second Source # | |
Defined in Data.Units.SI conversionRatio :: Second -> Rational # canonicalConvRatio :: Second -> Rational | |
type UnitFactorsOf Second Source # | |
Defined in Data.Units.SI type UnitFactorsOf Second = If (IsCanonical Second) '['F Second One] (UnitFactorsOf (BaseUnit Second)) | |
type DimOfUnit Second Source # | |
Defined in Data.Units.SI | |
type BaseUnit Second Source # | |
Defined in Data.Units.SI |
Derived SI unit
Instances
Show Minute Source # | |
Unit Minute Source # | |
Defined in Data.Units.SI conversionRatio :: Minute -> Rational # canonicalConvRatio :: Minute -> Rational | |
type UnitFactorsOf Minute Source # | |
Defined in Data.Units.SI type UnitFactorsOf Minute = If (IsCanonical Minute) '['F Minute One] (UnitFactorsOf (BaseUnit Minute)) | |
type DimOfUnit Minute Source # | |
type BaseUnit Minute Source # | |
Defined in Data.Units.SI |
Derived SI unit
Instances
Show Hour Source # | |
Unit Hour Source # | |
Defined in Data.Units.SI conversionRatio :: Hour -> Rational # canonicalConvRatio :: Hour -> Rational | |
type UnitFactorsOf Hour Source # | |
Defined in Data.Units.SI | |
type DimOfUnit Hour Source # | |
type BaseUnit Hour Source # | |
Defined in Data.Units.SI |
Instances
Show Ampere Source # | |
Unit Ampere Source # | |
Defined in Data.Units.SI conversionRatio :: Ampere -> Rational # canonicalConvRatio :: Ampere -> Rational | |
type UnitFactorsOf Ampere Source # | |
Defined in Data.Units.SI type UnitFactorsOf Ampere = If (IsCanonical Ampere) '['F Ampere One] (UnitFactorsOf (BaseUnit Ampere)) | |
type DimOfUnit Ampere Source # | |
Defined in Data.Units.SI | |
type BaseUnit Ampere Source # | |
Defined in Data.Units.SI |
Instances
Show Kelvin Source # | |
Unit Kelvin Source # | |
Defined in Data.Units.SI conversionRatio :: Kelvin -> Rational # canonicalConvRatio :: Kelvin -> Rational | |
type UnitFactorsOf Kelvin Source # | |
Defined in Data.Units.SI type UnitFactorsOf Kelvin = If (IsCanonical Kelvin) '['F Kelvin One] (UnitFactorsOf (BaseUnit Kelvin)) | |
type DimOfUnit Kelvin Source # | |
Defined in Data.Units.SI | |
type BaseUnit Kelvin Source # | |
Defined in Data.Units.SI |
Instances
Show Mole Source # | |
Unit Mole Source # | |
Defined in Data.Units.SI conversionRatio :: Mole -> Rational # canonicalConvRatio :: Mole -> Rational | |
type UnitFactorsOf Mole Source # | |
Defined in Data.Units.SI | |
type DimOfUnit Mole Source # | |
Defined in Data.Units.SI | |
type BaseUnit Mole Source # | |
Defined in Data.Units.SI |
Instances
Show Candela Source # | |
Unit Candela Source # | |
Defined in Data.Units.SI conversionRatio :: Candela -> Rational # | |
type UnitFactorsOf Candela Source # | |
Defined in Data.Units.SI type UnitFactorsOf Candela = If (IsCanonical Candela) '['F Candela One] (UnitFactorsOf (BaseUnit Candela)) | |
type DimOfUnit Candela Source # | |
Defined in Data.Units.SI | |
type BaseUnit Candela Source # | |
Defined in Data.Units.SI |
The two angular dimensions that must be fundamental dimensions.
Instances
Show Radian Source # | |
Unit Radian Source # | |
Defined in Data.Units.SI conversionRatio :: Radian -> Rational # canonicalConvRatio :: Radian -> Rational | |
type UnitFactorsOf Radian Source # | |
Defined in Data.Units.SI type UnitFactorsOf Radian = If (IsCanonical Radian) '['F Radian One] (UnitFactorsOf (BaseUnit Radian)) | |
type DimOfUnit Radian Source # | |
Defined in Data.Units.SI | |
type BaseUnit Radian Source # | |
Defined in Data.Units.SI |
Instances
Show Steradian Source # | |
Unit Steradian Source # | |
Defined in Data.Units.SI conversionRatio :: Steradian -> Rational # | |
type UnitFactorsOf Steradian Source # | |
Defined in Data.Units.SI type UnitFactorsOf Steradian = If (IsCanonical Steradian) '['F Steradian One] (UnitFactorsOf (BaseUnit Steradian)) | |
type DimOfUnit Steradian Source # | |
Defined in Data.Units.SI | |
type BaseUnit Steradian Source # | |
Defined in Data.Units.SI |
This is not in the SI standard, but is used widely.
Instances
Show Newton Source # | |
Unit Newton Source # | |
Defined in Data.Units.SI conversionRatio :: Newton -> Rational # canonicalConvRatio :: Newton -> Rational | |
type UnitFactorsOf Newton Source # | |
Defined in Data.Units.SI type UnitFactorsOf Newton = If (IsCanonical Newton) '['F Newton One] (UnitFactorsOf (BaseUnit Newton)) | |
type DimOfUnit Newton Source # | |
type BaseUnit Newton Source # | |
Instances
Show Pascal Source # | |
Unit Pascal Source # | |
Defined in Data.Units.SI conversionRatio :: Pascal -> Rational # canonicalConvRatio :: Pascal -> Rational | |
type UnitFactorsOf Pascal Source # | |
Defined in Data.Units.SI type UnitFactorsOf Pascal = If (IsCanonical Pascal) '['F Pascal One] (UnitFactorsOf (BaseUnit Pascal)) | |
type DimOfUnit Pascal Source # | |
type BaseUnit Pascal Source # | |
Instances
Show Coulomb Source # | |
Unit Coulomb Source # | |
Defined in Data.Units.SI conversionRatio :: Coulomb -> Rational # | |
type UnitFactorsOf Coulomb Source # | |
Defined in Data.Units.SI type UnitFactorsOf Coulomb = If (IsCanonical Coulomb) '['F Coulomb One] (UnitFactorsOf (BaseUnit Coulomb)) | |
type DimOfUnit Coulomb Source # | |
type BaseUnit Coulomb Source # | |
Instances
Show Siemens Source # | |
Unit Siemens Source # | |
Defined in Data.Units.SI conversionRatio :: Siemens -> Rational # | |
type UnitFactorsOf Siemens Source # | |
Defined in Data.Units.SI type UnitFactorsOf Siemens = If (IsCanonical Siemens) '['F Siemens One] (UnitFactorsOf (BaseUnit Siemens)) | |
type DimOfUnit Siemens Source # | |
type BaseUnit Siemens Source # | |
Instances
Show Lumen Source # | |
Unit Lumen Source # | |
Defined in Data.Units.SI conversionRatio :: Lumen -> Rational # canonicalConvRatio :: Lumen -> Rational | |
type UnitFactorsOf Lumen Source # | |
Defined in Data.Units.SI | |
type DimOfUnit Lumen Source # | |
type BaseUnit Lumen Source # | |
Defined in Data.Units.SI |
Instances
Show Becquerel Source # | |
Unit Becquerel Source # | |
Defined in Data.Units.SI conversionRatio :: Becquerel -> Rational # | |
type UnitFactorsOf Becquerel Source # | |
Defined in Data.Units.SI type UnitFactorsOf Becquerel = If (IsCanonical Becquerel) '['F Becquerel One] (UnitFactorsOf (BaseUnit Becquerel)) | |
type DimOfUnit Becquerel Source # | |
type BaseUnit Becquerel Source # | |
Instances
Show Sievert Source # | |
Unit Sievert Source # | |
Defined in Data.Units.SI conversionRatio :: Sievert -> Rational # | |
type UnitFactorsOf Sievert Source # | |
Defined in Data.Units.SI type UnitFactorsOf Sievert = If (IsCanonical Sievert) '['F Sievert One] (UnitFactorsOf (BaseUnit Sievert)) | |
type DimOfUnit Sievert Source # | |
type BaseUnit Sievert Source # | |
Instances
Show Degree Source # | |
Unit Degree Source # | |
Defined in Data.Units.SI conversionRatio :: Degree -> Rational # canonicalConvRatio :: Degree -> Rational | |
type UnitFactorsOf Degree Source # | |
Defined in Data.Units.SI type UnitFactorsOf Degree = If (IsCanonical Degree) '['F Degree One] (UnitFactorsOf (BaseUnit Degree)) | |
type DimOfUnit Degree Source # | |
type BaseUnit Degree Source # | |
Defined in Data.Units.SI |
Instances
Show Arcminute Source # | |
Unit Arcminute Source # | |
Defined in Data.Units.SI conversionRatio :: Arcminute -> Rational # | |
type UnitFactorsOf Arcminute Source # | |
Defined in Data.Units.SI type UnitFactorsOf Arcminute = If (IsCanonical Arcminute) '['F Arcminute One] (UnitFactorsOf (BaseUnit Arcminute)) | |
type DimOfUnit Arcminute Source # | |
type BaseUnit Arcminute Source # | |
Defined in Data.Units.SI |
Instances
Show Arcsecond Source # | |
Unit Arcsecond Source # | |
Defined in Data.Units.SI conversionRatio :: Arcsecond -> Rational # | |
type UnitFactorsOf Arcsecond Source # | |
Defined in Data.Units.SI type UnitFactorsOf Arcsecond = If (IsCanonical Arcsecond) '['F Arcsecond One] (UnitFactorsOf (BaseUnit Arcsecond)) | |
type DimOfUnit Arcsecond Source # | |
type BaseUnit Arcsecond Source # | |
Defined in Data.Units.SI |
Derived SI unit
Instances
Show Hectare Source # | |
Unit Hectare Source # | |
Defined in Data.Units.SI conversionRatio :: Hectare -> Rational # | |
type UnitFactorsOf Hectare Source # | |
Defined in Data.Units.SI type UnitFactorsOf Hectare = If (IsCanonical Hectare) '['F Hectare One] (UnitFactorsOf (BaseUnit Hectare)) | |
type DimOfUnit Hectare Source # | |
type BaseUnit Hectare Source # | |
Derived SI unit
A list of the names of all unit types. Useful with
makeQuasiQuoter
.