؝A      !"#$%&'()*+,-./0123456789:;<=>?@NoneA{A unit normal form is a signed multiset of atoms; we maintain the invariant that the map does not contain any zero values.BAn 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).C:Base units are just represented as strings, for simplicityD7The group identity, representing the dimensionless unitE(Construct a normalised unit from an atomF2Construct a normalised unit from a single variableG3Construct a normalised unit from a single base unitHvConstruct a normalised unit from a stuck type family application: this must not be one of the built-in type families!I>Construct a normalised unit from a list of atom-exponent pairsJ^Construct a normalised unit from an atom-exponent map, applying the signed multiset invariantK"Multiplication of normalised unitsLDivision of normalised unitsM#Expontentiation of normalised unitsNInvert a normalised unitO$Test whether a unit is dimensionlessP=Test whether a unit is constant (contains only base literals)Q,Extract the base units if a unit is constantRXTest whether an atom is a base unit (but not necessarily a *literal*, e.g. it could be Base b for some variable b)S+Test whether an atom is a literal base unitT?Test whether all exponents in a unit are divisble by an integerUYTest whether a type variable occurs in a unit (possibly under a type family application)VFView a unit as a list of atoms in order of ascending absolute exponentWDrop a variable from a unitX0Divide all the exponents in a unit by an integerY=Substitute the first unit for the variable in the second unit"AZ[B\]^CDEFGHIJKLMNOPQRSTUVWXY_`abAB\]^CDFGHIKLMNOPQRTUVWXYAZ[B\]^CDEFGHIJKLMNOPQRSTUVWXY_`abKLM Nonec@Contains references to the basic unit constructors declared in Data.UnitsOfMeasure, as loaded inside GHC.dThe Unit+ type constructor, to be promoted to a kindeThe Base data constructor of Unit , promoted to a type constructorfThe One type familygThe '(*:)' type familyhThe '(/:)' type familyiThe '(^:)' type familyjThe Unpack type familykThe  UnitSyntax+ type constructor, to be promoted to a kindlThe data constructor of  UnitSyntax , promoted to a type constructormThe '(~~)' type familynUnit promoted to a kindo Is this the Unit kind?pTTry 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.q8Convert a unit normal form to a type expression of kind Unitcrdefghijklmnopqcrdefghijklmnopqc rdefghijklmnopq Nonestustustu NonevPossible 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.wZA substitution is essentially a list of (variable, unit) pairs, but we keep the original xh that lead to the substitution being made, for use when turning the substitution back into constraints.y0Apply a substitution to a single normalised unitzCompose two substitutions{PAttempt to unify two normalised units to produce a unifying substitution. The xb is the equality between the non-normalised (and perhaps less substituted) unit type expressions.&|}~vwyz{|}~z|}~vwyz{NoneAThe 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 unitsWAnnoyingly, base doesn't appear to export enough stuff to make it possible to write a TestEquality SSymbol instance, so we cheat.'Test whether two %Xs represent the same units, up to the equivalence relation. TODO: this currently uses 6, but in principle it should be possible to avoid it.^Calculate a normal form of a syntactic unit: a map from base unit names to non-zero integers.(BExtract the runtime syntactic representation from a singleton unit)2Extract the runtime syntactic representation of a   !"#$%&'()  !"#$%&'() %&( !)'"#$ !"#$%&'()None !"'*345>N[*An existential wrapper type: * p is essentially exists x . p x.,kRepresents a quantity whose units have a syntactic representation that is known statically and at runtime..:Parse a quantity and check that it has the expected units./&Parse a quantity along with its units.0 Parse a unit. *+,-./0*+,-./0/0.*+,- *+,-./0None!"&'(*13457<>?CIKLN10Render a quantity nicely, followed by its units:'showQuantity (1 /: [u| 0.1 s / m kg |])"10.0 kg m / s"2Render a unit nicely:*showUnit (undefined :: proxy [u| 1 / s |])"s^-1"12121212None&'(14>IKLN 3>Converts a unit to the corresponding canonical representation.4+Two units are convertible if they are both 5H and they have the same canonical units (and hence the same dimension).5dA unit is "good" if all its base units have been defined, and have associated canonical base units.6yThis constraint will be satisfied if all the base units in a syntactically represented unit are in their canonical form.7This 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.8~Class to capture the dimensions to which base units belong. For a canonical base unit, the class instance can be left empty.90The canonical base unit for this base unit. If b is canonical, then 9 b = b. Otherwise, 9 b must itself be canonical.:NThe conversion ratio between this base unit and its canonical base unit. If b! is canonical then this ratio is 1.;,Automatically convert a quantity with units u so that its units are v , provided u and v have the same dimension.<Calculate 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 < [u| ft |] [u| m |].3456789:;< 3456789:;< ;<89:567433456789:;< None(<KLN =The =\ 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 [=|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 [=|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 [=|42 m|] is an expression of type   (  "m"), [= |-2.2 m|] is an expression of type   (  "m") , and [=|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 [= | 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.>YDeclare 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 [=| m |].??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 [=| N = kg m / s^2 |].@]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" = Base "byte" conversionBase _ = [u| 1 % 1024 kilobyte/byte |]This can also be written [=| 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.=>?@=>?@=>?@None!"'(*4<>?CIKLN  ;=>?@  =>?@; None (35>LNone !"#$%&'()*+,-./0122345667789:;<=>?@ABCDEF G H I JKLMNOPQRSTUVWXYZ[\]^_`Kabcdefgh i j k l m n o p q r s t u v w i x y z { |}~             w  M        uom-plugin-0.2.0.0Data.UnitsOfMeasure.PluginData.UnitsOfMeasure.InternalData.UnitsOfMeasure.SingletonData.UnitsOfMeasure.ReadData.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 KnownUnitunitSingSListSNilSConsSUnittestEquivalentSUnit forgetSUnitunitValSomeQuantityWithUnit readWithUnit readQuantityreadUnit showQuantityshowUnitToCanonicalUnit ConvertibleGood IsCanonical HasCanonicalHasCanonicalBaseUnitCanonicalBaseUnitconversionBaseconvertratioudeclareBaseUnitdeclareDerivedUnitdeclareConvertibleUnitNormUnitAtomBaseUnitoneatomvarUnitbaseUnitfamUnit 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.FloatsqrttestEqualitySymbol Unsafe.Coerce unsafeCoercenormaliseUnitSyntax forgetSList $fKnownList: $fKnownList[] $fKnownUnit:/$fTestEquality[]SList$fTestEqualityUnitSyntaxSUnit expToSomeUnitunitSyntaxToSomeUnit someListValexpToUnitSyntax$fReadQuantity showUnitBitsshowPosshowNegshowAtom$fShowQuantityToCBUAllIsCanonicalAllHasCanonical ListToCBUconversionRatiohelphelp'ghc-prim GHC.TypesDoubleTrueuExpuPatuTypeuDec parseUnitDecs declareUnit readNumberUnitDecl DefinedUnitConversionUnit parseUnitQTFCo:R:MkUnit"mph"TFCo:R:CanonicalBaseUnit"au"TFCo:R:CanonicalBaseUnit"sr"TFCo:R:MkUnit"ohm"TFCo:R:CanonicalBaseUnit"g"TFCo:R:MkUnit"cd"