uom-plugin-0.3.0.0: Units of measure as a GHC typechecker plugin

Contents

Description

Very very rough support for reading units of measure in the syntax used by Data.UnitsOfMeasure.Show.

Synopsis

# Documentation

Parse a quantity along with its units.

Parse a unit.

readWithUnit :: forall proxy a u. (Read a, KnownUnit u) => proxy u -> String -> Either String (Quantity a (Pack u)) Source #

Parse a quantity and check that it has the expected units.

data Some p where Source #

An existential wrapper type: Some p is essentially exists x . p x.

Constructors

 Some :: p x -> Some p

data QuantityWithUnit a u where Source #

Represents a quantity whose units have a syntactic representation that is known statically and at runtime.

Constructors

 QuantityWithUnit :: Quantity a (Pack u) -> SUnit u -> QuantityWithUnit a u