Safe Haskell | None |
---|---|
Language | Haskell2010 |
Experimental support for showing units of measure in a pretty syntax. This requires the units to be fully determined.
Apart from the definitions below, this module also exports a Show
instance for
, which is re-exported by
Data.UnitsOfMeasure.Quantity
a u
Documentation
showQuantity :: forall a u. (Show a, KnownUnit (Unpack u)) => Quantity a u -> String Source #
Render a quantity nicely, followed by its units:
>>>
showQuantity (1 /: [u| 0.1 s / m kg |])
"10.0 kg m / s"
showUnit :: forall proxy u. KnownUnit (Unpack u) => proxy u -> String Source #
Render a unit nicely:
>>>
showUnit (undefined :: proxy [u| 1 / s |])
"s^-1"