{-# LANGUAGE TemplateHaskell, TypeFamilies, TypeOperators #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Units.US.Troy -- Copyright : (C) 2013 Richard Eisenberg -- License : BSD-style (see LICENSE) -- Maintainer : Richard Eisenberg (rae@cs.brynmawr.edu) -- Stability : experimental -- Portability : non-portable -- -- This module defines troy measures of mass. The troy -- system is most often used when measuring precious metals. -- -- Included are all units mentioned here: -- -- 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: -- -- ----------------------------------------------------------------------------- module Data.Units.US.Troy ( module Data.Units.US.Troy, -- | The avoirdupois grain is the same as the troy grain Grain(..) ) where import Data.Metrology.TH import Data.Units.US.Avoirdupois ( Grain(..) ) import Language.Haskell.TH declareDerivedUnit "Pennyweight" [t| Grain |] 24 (Just "dwt") declareDerivedUnit "Ounce" [t| Pennyweight |] 20 (Just "ozt") declareDerivedUnit "Pound" [t| Ounce |] 12 (Just "lbt") -- | Includes 'Grain', 'Pennyweight', 'Ounce', and 'Pound' troyMassMeasures :: [Name] troyMassMeasures = [ ''Grain, ''Pennyweight, ''Ounce, ''Pound ]