A9      !"#$%&'()*+,-./012345678 None9{A unit normal form is a signed multiset of atoms; we maintain the invariant that the map does not contain any zero values.:An atom in the normal form is either a base unit, a variable or a stuck type family application (but not one of the built-in type families that correspond to group operations).;:Base units are just represented as strings, for simplicity<7The group identity, representing the dimensionless unit=(Construct a normalised unit from an atom>2Construct a normalised unit from a single variable?3Construct a normalised unit from a single base unit@vConstruct a normalised unit from a stuck type family application: this must not be one of the built-in type families!A>Construct a normalised unit from a list of atom-exponent pairsB^Construct a normalised unit from an atom-exponent map, applying the signed multiset invariantC"Multiplication of normalised unitsDDivision of normalised unitsE#Expontentiation of normalised unitsFInvert a normalised unitG$Test whether a unit is dimensionlessH=Test whether a unit is constant (contains only base literals)I,Extract the base units if a unit is constantJXTest whether an atom is a base unit (but not necessarily a *literal*, e.g. it could be Base b for some variable b)K+Test whether an atom is a literal base unitL?Test whether all exponents in a unit are divisble by an integerMYTest whether a type variable occurs in a unit (possibly under a type family application)NFView a unit as a list of atoms in order of ascending absolute exponentODrop a variable from a unitP0Divide all the exponents in a unit by an integerQ=Substitute the first unit for the variable in the second unit"9RS:TUV;<=>?@ABCDEFGHIJKLMNOPQWXYZ9:TUV;<>?@ACDEFGHIJLMNOPQ9RS:TUV;<=>?@ABCDEFGHIJKLMNOPQWXYZCDENone[@Contains references to the basic unit constructors declared in Data.UnitsOfMeasure, as loaded inside GHC.\The Unit+ type constructor, to be promoted to a kind]The Base data constructor of Unit , promoted to a type constructor^The One type family_The '(*:)' type family`The '(/:)' type familyaThe '(^:)' type familybThe Unpack type familycThe  UnitSyntax+ type constructor, to be promoted to a kinddThe data constructor of  UnitSyntax , promoted to a type constructoreThe '(~~)' type familyfUnit promoted to a kindg Is this the Unit kind?hTTry to convert a type to a unit normal form; this does not check the type has kind Unit, and may fail even if it does.i8Convert a unit normal form to a type expression of kind Unit[j\]^_`abcdefghi[j\]^_`abcdefghi[ j\]^_`abcdefghi Noneklmklmklm NonenPossible results of unifying a single pair of units. In the non-failing cases, we return a substitution and a list of fresh variables that were created.oZA substitution is essentially a list of (variable, unit) pairs, but we keep the original ph that lead to the substitution being made, for use when turning the substitution back into constraints.q0Apply a substitution to a single normalised unitrCompose two substitutionssPAttempt to unify two normalised units to produce a unifying substitution. The pb is the equality between the non-normalised (and perhaps less substituted) unit type expressions.&tuvwxyz{|}~noqrstuvwxyz{|}~rtuvwxyz{|}~noqrsNoneAThe plugin that GHC will load when this module is used with the -fplugin option.yProduce bogus evidence for a constraint, including actual equality constraints and our fake '(~~)' equality constraints.  None (*7>?CKLeThis type family is used for translating unit names (as type-level strings) into units. It will be  < for base units or expand the definition for derived units.:The instances displayed by Haddock are available only if Data.UnitsOfMeasure.Defs is imported.BThis is a bit of a hack, honestly, but a good hack. Constraints u ~~ v are just like equalities u ~ va, except solving them will be delayed until the plugin. This may lead to better inferred types.fUnpack a unit as a syntactic representation, where the order of units is deterministic. For example:    = []  []   (  "s"    "m") = ["m","s"]  [],This does not break type soundness because  will reduce only when the unit is entirely constant, and it does not allow the structure of the unit to be observed. The reduction behaviour is implemented by the plugin, because we cannot define it otherwise.)Take the product of a list of base units.EPack up a syntactic representation of a unit as a unit. For example:   ([]  []) =    (["m"]  ["s","s"]) =   "m"    "s" ^: 22This is a perfectly ordinary closed type family.  is a left inverse of  up to the equational theory of units, but it is not a right inverse (because there are multiple list representations of the same unit).RSyntactic representation of a unit as a pair of lists of base units, for example  is represented as []  [] and   "m"    "s" ^: 2 is represented as ["m"]  ["s","s"].A  Quantity a uC is represented identically to a value of underlying numeric type a, but with units u.  Warning: the  N constructor allows module invariants to be violated, so use it with caution! Exponentiation (to a positive power) for units of measure; negative exponents are not yet supported (they require an Integer kind) Division for units of measure #Multiplication for units of measure  Base unit%Dimensionless unit (identity element)(Kind) Units of measure*Extract the underlying value of a quantity@Zero is polymorphic in its units: this is required because the ; instance constrains the quantity to be dimensionless, so 0 :: Quantity a u is not well typed. Construct a C from a dimensionless value. Note that for numeric literals, the  and < instances allow them to be treated as quantities directly. Addition (,) of quantities requires the units to match.Multiplication (%) of quantities multiplies the units. Subtraction (,) of quantities requires the units to match. Negation (,) of quantities is polymorphic in the units.Absolute value (,) of quantities is polymorphic in the units. The sign (-) of a quantity gives a dimensionless result. Convert an  quantity into any  type (). Division (") of quantities divides the units. Reciprocal (') of quantities reciprocates the units. Convert a  quantity into any  type ().Taking the square root (b) of a quantity requires its units to be a square. Fractional units are not currently supported.        None!"&'(*13457<>?CIKLN A constraint  xs means that xsM must be a list of base units that is statically known but passed at runtime  A constraint   u means that uH must be a concrete unit that is statically known but passed at runtime"&Singleton type for lists of base units%PSingleton type for concrete units of measure represented as lists of base units'BExtract the runtime syntactic representation from a singleton unit(2Extract the runtime syntactic representation of a   !"#$%&'(  !"#$%&'( %&' !("#$  !"#$%&'(None!"&'(*13457<>?CIKLN)0Render a quantity nicely, followed by its units:'showQuantity (1 /: [u| 0.1 s / m kg |])"10.0 kg m / s"*Render a unit nicely:*showUnit (undefined :: proxy [u| 1 / s |])"s^-1")*)*)*)*None&'(14>IKLN +>Converts a unit to the corresponding canonical representation.,+Two units are convertible if they are both -H and they have the same canonical units (and hence the same dimension).-dA unit is "good" if all its base units have been defined, and have associated canonical base units..This constraint will be satisfied if all the base units in a syntactically represented unit have associated canonical representations./]Convert a unit into its canonical representation, where units are represented syntactically.0~Class to capture the dimensions to which base units belong. For a canonical base unit, the class instance can be left empty.10The canonical base unit for this base unit. If b is canonical, then 1 b = b. Otherwise, 1 b must itself be canonical.2NThe conversion ratio between this base unit and its canonical base unit. If b! is canonical then this ratio is 1.3,Automatically convert a quantity with units u so that its units are v , provided u and v have the same dimension.4Calculate the conversion ratio between two units with the same dimension. The slightly unusual proxy arguments allow this to be called using quasiquoters to specify the units, for example 4 [u| ft |] [u| m |].+,-./01234 +,-./01234 34012-.,+/ +,-./01234 None(<KLN 5The 5\ quasiquoter may be used to create units or quantities; its meaning depends on the context:in a declaration context, it creates new base and derived units from a comma-separated list of names with optional definitions, for example [5|kg, m, s, N = kg * m/s^2|];^in a type context, it parses a single unit and converts it into the corresponding type, so [5|m/s|] becomes the type   "m" /:   "s" of kind ;5in an expression context, it can be used to create a 4 corresponding to a numeric literal, for example [5|42 m|] is an expression of type   (  "m"), [5 |-2.2 m|] is an expression of type   (  "m") , and [5|m|] alone is a function of type a ->  a (  "m");]in a pattern context, it can be used to match on a particular value of a quantity with an  or % representation type, for example f [5 | 42 m |] = $ is a (partial) function of type   [u|m|] -> Bool.XParse a unit expression optionally preceded by a literal, and create a constructor for B with the given units (applied to the literal if one is present).cParse an integer or rational literal followed by a unit expression, and create a pattern match on   u or   uJ. Unfortunately we cannot easily support arbitrary representation types.CParse a unit expression and convert it into the corresponding type.6Convert a unit expression into the corresponding type.YParse the string as a mixture of base units and derived units, and create corresponding  type instance declarations.?Parse a comma-separated list of unit declarations, for example: kg, m, s, N = kg * m/s^2UGiven a unit name and an optional definition, create an appropriate instance of the  type family.6YDeclare a canonical base unit of the given name, which must not contain any spaces, e.g. declareBaseUnit "m"produces Etype instance MkUnit "m" = Base "m" instance HasCanonicalBaseUnit "m"This can also be written [5| m |].7?Declare a derived unit with the given name and definition, e.g. #declareDerivedUnit "N" "kg m / s^2"produces Atype instance MkUnit "N" = Base "kg" *: Base "m" /: Base "s" ^: 2This can also be written [5| N = kg m / s^2 |].8]Declare a base unit of the given name, which is convertible to the canonical base unit, e.g. -declareConvertibleUnit "kilobyte" 1024 "byte"produces type instance MkUnit "kilobyte" = Base "kilobyte" instance HasCanonicalBaseUnit "kilobyte" where type CanonicalBaseUnit "kilobyte" = "byte" conversionBase _ = [u| 1 % 1024 kilobyte/byte |]This can also be written [5| kilobyte = 1024 byte |]. See Data.UnitsOfMeasure.Convert( for more information about conversions.iRead either an integer or a rational from a string, if possible, and return the remainder of the string.567856785678None!"'(*4<>?CIKLN  35678  56783 None (35>L None !"#$%&'()*+,-./01123456789:;<=>? @ A B CDEFGHIJKLMNOPQRSTUVWXYDZ[\]^_`abcdefghijklmnopb q r s t uvwx y z { | } ~           p  F       uom-plugin-0.1.0.0Data.UnitsOfMeasure.PluginData.UnitsOfMeasure.InternalData.UnitsOfMeasure.SingletonData.UnitsOfMeasure.ShowData.UnitsOfMeasure.ConvertData.UnitsOfMeasure%Data.UnitsOfMeasure.Plugin.NormalForm"Data.UnitsOfMeasure.Plugin.ConvertTcPluginExtras Data.UnitsOfMeasure.Plugin.UnifyData.UnitsOfMeasure.THData.UnitsOfMeasure.DefsData.UnitsOfMeasure.TutorialpluginMkUnit~~UnpackProdPack UnitSyntax:/Quantity MkQuantity^:/:*:BaseOneUnit unQuantityzeromk+:-:negate'abs'signum' fromInteger'recip' fromRational'sqrt' KnownListlistSing KnownUnitunitSingSListSNilSConsSUnit forgetSUnitunitVal showQuantityshowUnitToCanonicalUnit ConvertibleGood HasCanonicalMapCBUHasCanonicalBaseUnitCanonicalBaseUnitconversionBaseconvertratioudeclareBaseUnitdeclareDerivedUnitdeclareConvertibleUnitNormUnitAtomBaseUnitoneatomvarUnitbaseUnitfamUnit mkNormUnit mkNormUnitMapinvertisOne isConstant maybeConstantisBase isBaseLiteral divisibleoccurs ascendingleftoverdivideExponents substUnit _NormUnitBaseAtomVarAtomFamAtom$fOutputableNormUnit$fOutputableAtom $fOrdAtom$fEqAtomUnitDefs unitKindCon unitBaseTyCon unitOneTyConmulTyCondivTyConexpTyCon unpackTyConunitSyntaxTyConunitSyntaxPromotedDataCon equivTyConunitKind isUnitKind normaliseUnit reifyUnit newUnique newWantedCt newGivenCt UnifyResultTySubstghc TcRnTypesCt substsUnit substsSubst unifyUnitsSimplifyResult Simplified ImpossiblesimplifyImpossiblesimplifyRemaining SimplifyStatesimplifyFreshVars simplifySubstsimplifyUnsubstsimplifySolved simplifyStuck UnitEqualityWinDrawLose SubstItemsiVarsiUnitsiCtsubstsUnitEquality extendSubstunifyOne initialState simplifyUnitswindrawaddStuck$fOutputableSimplifyResult$fOutputableSimplifyState$fOutputableUnifyResult$fOutputableSubstItemevMagic uomPluginunitsOfMeasureSolver substItemToCtlookForUnpackstoUnitEqualityfromUnitEqualitylookupUnitDefsbaseGHC.NumNumGHC.Real Fractional+*-negateabssignum integer-gmpGHC.Integer.TypeIntegerIntegral fromInteger/recipRational fromRational GHC.Floatsqrt forgetSList $fKnownList: $fKnownList[] $fKnownUnit:/ showUnitBitsshowPosshowNegshowAtom$fShowQuantityAllHasCanonical ListMapCBUconversionRatiohelphelp'ghc-prim GHC.TypesDoubleTrueuExpuPatuTypeuDec parseUnitDecs declareUnit readNumberUnitDecl DefinedUnitConversionUnit parseUnitQTFCo:R:MkUnit"mph"TFCo:R:MkUnit"au"TFCo:R:MkUnit"ohm"TFCo:R:CanonicalBaseUnit"g"TFCo:R:MkUnit"cd"