Copyright | (C) 2013 Richard Eisenberg |
---|---|
License | BSD-style (see LICENSE) |
Maintainer | Richard Eisenberg (eir@cis.upenn.edu) |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
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
- 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
data NauticalMile Source
Show NauticalMile | |
Unit NauticalMile | |
type UnitFactorsOf NauticalMile = If [Factor *] (IsCanonical NauticalMile) ((:) (Factor *) (F * NauticalMile One) ([] (Factor *))) (UnitFactorsOf (BaseUnit NauticalMile)) | |
type DimOfUnit NauticalMile = DimOfUnit (BaseUnit NauticalMile) | |
type BaseUnit NauticalMile = (:@) Kilo Meter |
Velocity
Area
Volume
These are all liquid measures. Solid measures are different.
data Tablespoon Source
Show Tablespoon | |
Unit Tablespoon | |
type UnitFactorsOf Tablespoon = If [Factor *] (IsCanonical Tablespoon) ((:) (Factor *) (F * Tablespoon One) ([] (Factor *))) (UnitFactorsOf (BaseUnit Tablespoon)) | |
type DimOfUnit Tablespoon = DimOfUnit (BaseUnit Tablespoon) | |
type BaseUnit Tablespoon = Teaspoon |
data FluidOunce Source
Show FluidOunce | |
Unit FluidOunce | |
type UnitFactorsOf FluidOunce = If [Factor *] (IsCanonical FluidOunce) ((:) (Factor *) (F * FluidOunce One) ([] (Factor *))) (UnitFactorsOf (BaseUnit FluidOunce)) | |
type DimOfUnit FluidOunce = DimOfUnit (BaseUnit FluidOunce) | |
type BaseUnit FluidOunce = Gallon |
Mass
These are all in the avoirdupois system
Pressure
data Atmosphere Source
Show Atmosphere | |
Unit Atmosphere | |
type UnitFactorsOf Atmosphere = If [Factor *] (IsCanonical Atmosphere) ((:) (Factor *) (F * Atmosphere One) ([] (Factor *))) (UnitFactorsOf (BaseUnit Atmosphere)) | |
type DimOfUnit Atmosphere = DimOfUnit (BaseUnit Atmosphere) | |
type BaseUnit Atmosphere = (:@) Kilo Pascal |
Energy
data FoodCalorie Source
Show FoodCalorie | |
Unit FoodCalorie | |
type UnitFactorsOf FoodCalorie = If [Factor *] (IsCanonical FoodCalorie) ((:) (Factor *) (F * FoodCalorie One) ([] (Factor *))) (UnitFactorsOf (BaseUnit FoodCalorie)) | |
type DimOfUnit FoodCalorie = DimOfUnit (BaseUnit FoodCalorie) | |
type BaseUnit FoodCalorie = (:@) Kilo Calorie |
Power
data Horsepower Source
Show Horsepower | |
Unit Horsepower | |
type UnitFactorsOf Horsepower = If [Factor *] (IsCanonical Horsepower) ((:) (Factor *) (F * Horsepower One) ([] (Factor *))) (UnitFactorsOf (BaseUnit Horsepower)) | |
type DimOfUnit Horsepower = DimOfUnit (BaseUnit Horsepower) | |
type BaseUnit Horsepower = Watt |