| 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 |
Data.Units.US
Description
This module defines the American customary system of units. Because
there are some names that are conflicted, even within this system,
there are several modules underneath here, defining sub-parts of
the US system. This module gathers together a subjective set of
units users will commonly wish to use. It also exports type instances
DefaultUnitOfDim that use the SI internal representations. This
choice is made for inter-compatibility with SI computations. If you
want the foot-pound-second system, use the FPS.
Included are all units mentioned here: http://en.wikipedia.org/wiki/United_States_customary_units Where possible, conversion rates have been independently verified at a US government website. However, Wikipedia's base is much better organized than any government resource immediately available. The US government references used are as follows: http://nist.gov/pml/wmd/metric/upload/SP1038.pdf http://nist.gov/pml/wmd/pubs/upload/appc-14-hb44-final.pdf
Synopsis
- data Angstrom = Angstrom
- data Mil = Mil
- data Point = Point
- data Pica = Pica
- data Inch = Inch
- data Foot = Foot
- data Yard = Yard
- data Mile = Mile
- data NauticalMile = NauticalMile
- data Knot = Knot
- data Acre = Acre
- data Teaspoon = Teaspoon
- data Tablespoon = Tablespoon
- data FluidOunce = FluidOunce
- data Cup = Cup
- data Pint = Pint
- data Quart = Quart
- data Gallon = Gallon
- data Ounce = Ounce
- data Pound = Pound
- data Ton = Ton
- data Atmosphere = Atmosphere
- data Bar = Bar
- data FoodCalorie = FoodCalorie
- data Therm = Therm
- data Btu = Btu
- data Horsepower = Horsepower
Lengths
Constructors
| Angstrom |
Instances
| Show Angstrom Source # | |
| Unit Angstrom Source # | |
| type UnitFactorsOf Angstrom Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Angstrom = If (IsCanonical Angstrom) (F Angstrom One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Angstrom)) | |
| type DimOfUnit Angstrom Source # | |
| type BaseUnit Angstrom Source # | |
Constructors
| Mil |
Instances
| Show Mil Source # | |
| Unit Mil Source # | |
| type UnitFactorsOf Mil Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Mil = If (IsCanonical Mil) (F Mil One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Mil)) | |
| type DimOfUnit Mil Source # | |
| type BaseUnit Mil Source # | |
Defined in Data.Units.US.Misc | |
Constructors
| Point |
Instances
| Show Point Source # | |
| Unit Point Source # | |
| type UnitFactorsOf Point Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Point = If (IsCanonical Point) (F Point One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Point)) | |
| type DimOfUnit Point Source # | |
| type BaseUnit Point Source # | |
Defined in Data.Units.US.Misc | |
Constructors
| Pica |
Instances
| Show Pica Source # | |
| Unit Pica Source # | |
| type UnitFactorsOf Pica Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Pica = If (IsCanonical Pica) (F Pica One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Pica)) | |
| type DimOfUnit Pica Source # | |
| type BaseUnit Pica Source # | |
Defined in Data.Units.US.Misc | |
Constructors
| Inch |
Instances
| Show Inch Source # | |
| Unit Inch Source # | |
| type UnitFactorsOf Inch Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Inch = If (IsCanonical Inch) (F Inch One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Inch)) | |
| type DimOfUnit Inch Source # | |
| type BaseUnit Inch Source # | |
Defined in Data.Units.US.Misc | |
Constructors
| Foot |
Instances
| Show Foot Source # | |
| Unit Foot Source # | |
| type UnitFactorsOf Foot Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Foot = If (IsCanonical Foot) (F Foot One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Foot)) | |
| type DimOfUnit Foot Source # | |
| type BaseUnit Foot Source # | |
Defined in Data.Units.US.Misc | |
Constructors
| Yard |
Instances
| Show Yard Source # | |
| Unit Yard Source # | |
| type UnitFactorsOf Yard Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Yard = If (IsCanonical Yard) (F Yard One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Yard)) | |
| type DimOfUnit Yard Source # | |
| type BaseUnit Yard Source # | |
Defined in Data.Units.US.Misc | |
Constructors
| Mile |
Instances
| Show Mile Source # | |
| Unit Mile Source # | |
| type UnitFactorsOf Mile Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Mile = If (IsCanonical Mile) (F Mile One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Mile)) | |
| type DimOfUnit Mile Source # | |
| type BaseUnit Mile Source # | |
Defined in Data.Units.US.Misc | |
data NauticalMile Source #
Constructors
| NauticalMile |
Instances
| Show NauticalMile Source # | |
Defined in Data.Units.US.Misc Methods showsPrec :: Int -> NauticalMile -> ShowS # show :: NauticalMile -> String # showList :: [NauticalMile] -> ShowS # | |
| Unit NauticalMile Source # | |
Defined in Data.Units.US.Misc Associated Types type BaseUnit NauticalMile :: Type # type DimOfUnit NauticalMile :: Type # type UnitFactorsOf NauticalMile :: [Factor Type] # | |
| type UnitFactorsOf NauticalMile Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf NauticalMile = If (IsCanonical NauticalMile) (F NauticalMile One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit NauticalMile)) | |
| type DimOfUnit NauticalMile Source # | |
Defined in Data.Units.US.Misc | |
| type BaseUnit NauticalMile Source # | |
Defined in Data.Units.US.Misc | |
Velocity
Constructors
| Knot |
Instances
| Show Knot Source # | |
| Unit Knot Source # | |
| type UnitFactorsOf Knot Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Knot = If (IsCanonical Knot) (F Knot One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Knot)) | |
| type DimOfUnit Knot Source # | |
| type BaseUnit Knot Source # | |
Defined in Data.Units.US.Misc | |
Area
Constructors
| Acre |
Volume
These are all liquid measures. Solid measures are different.
Constructors
| Teaspoon |
Instances
| Show Teaspoon Source # | |
| Unit Teaspoon Source # | |
| type UnitFactorsOf Teaspoon Source # | |
Defined in Data.Units.US.Liquid type UnitFactorsOf Teaspoon = If (IsCanonical Teaspoon) (F Teaspoon One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Teaspoon)) | |
| type DimOfUnit Teaspoon Source # | |
| type BaseUnit Teaspoon Source # | |
Defined in Data.Units.US.Liquid | |
data Tablespoon Source #
Constructors
| Tablespoon |
Instances
| Show Tablespoon Source # | |
Defined in Data.Units.US.Liquid Methods showsPrec :: Int -> Tablespoon -> ShowS # show :: Tablespoon -> String # showList :: [Tablespoon] -> ShowS # | |
| Unit Tablespoon Source # | |
Defined in Data.Units.US.Liquid Associated Types type BaseUnit Tablespoon :: Type # type DimOfUnit Tablespoon :: Type # type UnitFactorsOf Tablespoon :: [Factor Type] # | |
| type UnitFactorsOf Tablespoon Source # | |
Defined in Data.Units.US.Liquid type UnitFactorsOf Tablespoon = If (IsCanonical Tablespoon) (F Tablespoon One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Tablespoon)) | |
| type DimOfUnit Tablespoon Source # | |
Defined in Data.Units.US.Liquid | |
| type BaseUnit Tablespoon Source # | |
Defined in Data.Units.US.Liquid | |
data FluidOunce Source #
Constructors
| FluidOunce |
Instances
| Show FluidOunce Source # | |
Defined in Data.Units.US.Liquid Methods showsPrec :: Int -> FluidOunce -> ShowS # show :: FluidOunce -> String # showList :: [FluidOunce] -> ShowS # | |
| Unit FluidOunce Source # | |
Defined in Data.Units.US.Liquid Associated Types type BaseUnit FluidOunce :: Type # type DimOfUnit FluidOunce :: Type # type UnitFactorsOf FluidOunce :: [Factor Type] # | |
| type UnitFactorsOf FluidOunce Source # | |
Defined in Data.Units.US.Liquid type UnitFactorsOf FluidOunce = If (IsCanonical FluidOunce) (F FluidOunce One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit FluidOunce)) | |
| type DimOfUnit FluidOunce Source # | |
Defined in Data.Units.US.Liquid | |
| type BaseUnit FluidOunce Source # | |
Defined in Data.Units.US.Liquid | |
Constructors
| Cup |
Instances
| Show Cup Source # | |
| Unit Cup Source # | |
| type UnitFactorsOf Cup Source # | |
Defined in Data.Units.US.Liquid type UnitFactorsOf Cup = If (IsCanonical Cup) (F Cup One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Cup)) | |
| type DimOfUnit Cup Source # | |
| type BaseUnit Cup Source # | |
Defined in Data.Units.US.Liquid | |
Constructors
| Pint |
Instances
| Show Pint Source # | |
| Unit Pint Source # | |
| type UnitFactorsOf Pint Source # | |
Defined in Data.Units.US.Liquid type UnitFactorsOf Pint = If (IsCanonical Pint) (F Pint One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Pint)) | |
| type DimOfUnit Pint Source # | |
| type BaseUnit Pint Source # | |
Defined in Data.Units.US.Liquid | |
Constructors
| Quart |
Instances
| Show Quart Source # | |
| Unit Quart Source # | |
| type UnitFactorsOf Quart Source # | |
Defined in Data.Units.US.Liquid type UnitFactorsOf Quart = If (IsCanonical Quart) (F Quart One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Quart)) | |
| type DimOfUnit Quart Source # | |
| type BaseUnit Quart Source # | |
Defined in Data.Units.US.Liquid | |
Constructors
| Gallon |
Instances
| Show Gallon Source # | |
| Unit Gallon Source # | |
| type UnitFactorsOf Gallon Source # | |
Defined in Data.Units.US.Liquid type UnitFactorsOf Gallon = If (IsCanonical Gallon) (F Gallon One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Gallon)) | |
| type DimOfUnit Gallon Source # | |
| type BaseUnit Gallon Source # | |
Mass
These are all in the avoirdupois system
Constructors
| Ounce |
Instances
| Show Ounce Source # | |
| Unit Ounce Source # | |
| type UnitFactorsOf Ounce Source # | |
Defined in Data.Units.US.Avoirdupois type UnitFactorsOf Ounce = If (IsCanonical Ounce) (F Ounce One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Ounce)) | |
| type DimOfUnit Ounce Source # | |
| type BaseUnit Ounce Source # | |
Defined in Data.Units.US.Avoirdupois | |
Constructors
| Pound |
Instances
| Show Pound Source # | |
| Unit Pound Source # | |
| type UnitFactorsOf Pound Source # | |
Defined in Data.Units.US.Avoirdupois type UnitFactorsOf Pound = If (IsCanonical Pound) (F Pound One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Pound)) | |
| type DimOfUnit Pound Source # | |
| type BaseUnit Pound Source # | |
Defined in Data.Units.US.Avoirdupois | |
Constructors
| Ton |
Instances
| Show Ton Source # | |
| Unit Ton Source # | |
| type UnitFactorsOf Ton Source # | |
Defined in Data.Units.US.Avoirdupois type UnitFactorsOf Ton = If (IsCanonical Ton) (F Ton One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Ton)) | |
| type DimOfUnit Ton Source # | |
| type BaseUnit Ton Source # | |
Defined in Data.Units.US.Avoirdupois | |
Pressure
data Atmosphere Source #
Constructors
| Atmosphere |
Instances
| Show Atmosphere Source # | |
Defined in Data.Units.US.Misc Methods showsPrec :: Int -> Atmosphere -> ShowS # show :: Atmosphere -> String # showList :: [Atmosphere] -> ShowS # | |
| Unit Atmosphere Source # | |
Defined in Data.Units.US.Misc Associated Types type BaseUnit Atmosphere :: Type # type DimOfUnit Atmosphere :: Type # type UnitFactorsOf Atmosphere :: [Factor Type] # | |
| type UnitFactorsOf Atmosphere Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Atmosphere = If (IsCanonical Atmosphere) (F Atmosphere One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Atmosphere)) | |
| type DimOfUnit Atmosphere Source # | |
Defined in Data.Units.US.Misc | |
| type BaseUnit Atmosphere Source # | |
Defined in Data.Units.US.Misc | |
Constructors
| Bar |
Energy
data FoodCalorie Source #
Constructors
| FoodCalorie |
Instances
| Show FoodCalorie Source # | |
Defined in Data.Units.US.Misc Methods showsPrec :: Int -> FoodCalorie -> ShowS # show :: FoodCalorie -> String # showList :: [FoodCalorie] -> ShowS # | |
| Unit FoodCalorie Source # | |
Defined in Data.Units.US.Misc Associated Types type BaseUnit FoodCalorie :: Type # type DimOfUnit FoodCalorie :: Type # type UnitFactorsOf FoodCalorie :: [Factor Type] # | |
| type UnitFactorsOf FoodCalorie Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf FoodCalorie = If (IsCanonical FoodCalorie) (F FoodCalorie One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit FoodCalorie)) | |
| type DimOfUnit FoodCalorie Source # | |
Defined in Data.Units.US.Misc | |
| type BaseUnit FoodCalorie Source # | |
Defined in Data.Units.US.Misc | |
Constructors
| Therm |
Constructors
| Btu |
Instances
| Show Btu Source # | |
| Unit Btu Source # | |
| type UnitFactorsOf Btu Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Btu = If (IsCanonical Btu) (F Btu One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Btu)) | |
| type DimOfUnit Btu Source # | |
| type BaseUnit Btu Source # | |
Defined in Data.Units.US.Misc | |
Power
data Horsepower Source #
Constructors
| Horsepower |
Instances
| Show Horsepower Source # | |
Defined in Data.Units.US.Misc Methods showsPrec :: Int -> Horsepower -> ShowS # show :: Horsepower -> String # showList :: [Horsepower] -> ShowS # | |
| Unit Horsepower Source # | |
Defined in Data.Units.US.Misc Associated Types type BaseUnit Horsepower :: Type # type DimOfUnit Horsepower :: Type # type UnitFactorsOf Horsepower :: [Factor Type] # | |
| type UnitFactorsOf Horsepower Source # | |
Defined in Data.Units.US.Misc type UnitFactorsOf Horsepower = If (IsCanonical Horsepower) (F Horsepower One ': ([] :: [Factor Type])) (UnitFactorsOf (BaseUnit Horsepower)) | |
| type DimOfUnit Horsepower Source # | |
Defined in Data.Units.US.Misc | |
| type BaseUnit Horsepower Source # | |
Defined in Data.Units.US.Misc | |