úÎ!ÂH¹      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œSafeAü, jinquantitieszHolds information about defined units, prefixes, and bases. Used when parsing new units and performing units conversions. jinquantitiesDMap from symbol to base units and conversion factor to those units. jinquantitiesPMap from alias to symbol. Symbols without aliases are present as identity maps. jinquantities]List of all units (no aliases). Used in prefix parser, and to detect duplicate definitions. jinquantitiesgList of all prefixes (no aliases). Used in prefix parser, and to detect duplicate prefix definitions. jinquantities"Multiplicative factor of prefixes. jinquantities Map from prefix alias to prefix. jinquantities$Map from base symbols to unit types.  jinquantitiesnHash of the definitions string used to create definitions. Defaults to -1 if modified or no string was used.  jinquantities]Data type for the three definition types. Used to hold definitions information when parsing. jinquantities%Useful for monadic computations with s. Some examples: ƒcomputation :: QuantityComputation Quantity computation = do x <- fromString "mile/hr" y <- unitsFromString "m/s" convert x yReturns Right 0.44704 meter / second hcomputation :: QuantityComputation Quantity computation = do x <- fromString "BADUNIT" convertBase xReturns Left (UndefinedUnitError BADUNIT) jinquantitiesCustom error type jinquantities,Used when trying to parse an undefined unit. jinquantitieshUsed when converting units that do not have the same dimensionality (example: convert meter to second). jinquantitiesCUsed internally when defining units and a unit is already defined. jinquantitiesEUsed internally when defining units and a prefix is already defined. jinquantities$Used when a string cannot be parsed. jinquantities:Used when two quantities come from different Definitions. jinquantities<Used when a scaling factor is present in a unit conversion. jinquantities#Combination of magnitude and units.  jinquantities Numerical magnitude of quantity.$magnitude <$> fromString "100 N * m" Right 100.0! jinquantitiesUnits associated with quantity. units <$> fromString "3.4 m/s^2"Right meter / second ** 2" jinquantitiesNData type to hold compound units, which are simple units multiplied together.$ jinquantities%Definitions used to create the units.% jinquantitiesPList of SimpleUnits that is interpreted as the units being multiplied together.& jinquantitiesERepresentation of single unit. For example: "mm^2" is represented as >SimpleUnit { symbol = "meter", prefix = "milli", power = 2.0 }+ jinquantities:String representation of a unit. Examples: "meter", "foot", jinquantities%Show a single unit, but prepend with  if negative- jinquantities"Removes decimal if almost integer.. jinquantities?Will be used when we allow pretty printing of fractional units./ jinquantitiesTConvenience function to extract SimpleUnit collection from Quantity's CompoundUnit.0 jinquantitiesIConvenience function to extract Definitions from Quantity's CompoundUnit.1 jinquantities:Convenience function to make quantity with no definitions.2 jinquantities)Sort units but put negative units at end.3 jinquantities@Combines equivalent units and removes units with powers of zero.4 jinquantities Helper function for reduceUnits.5 jinquantitiesNRemoves units with powers of zero that are left over from other computations.6 jinquantities+Negate the powers of a list of SimpleUnits.7 jinquantities)Inverts unit by negating the power field.8 jinquantitiesMultiplies two quantities.9 jinquantitiesDivides two quantities.: jinquantities(Exponentiates a quantity with an integer; jinquantities"Default, empty set of definitions.< jinquantities"Combine two Definitions structures=  ! "#%$&'*)(+,-./0123456789:;<=+&'*)("#%$,-.! /0123456789:  ;<SafeT2 N jinquantities Convert quantity to given units.3convert <$> fromString "m" <*> unitsFromString "ft"$Right (Right 3.280839895013123 foot)O jinquantities%Convert a quantity to its base units.#convertBase <$> fromString "newton"%Right 1000.0 gram meter / second ** 2P jinquantities Convert quantity to given units.Q jinquantities%Convert a quantity to its base units.R jinquantities.Converts a composite unit to its base quantityS jinquantities,Converts a simple unit to its base quantity.T jinquantities$Computes dimensionality of quantity.&dimensionality <$> fromString "newton"#Right [length] [mass] / [time] ** 2U jinquantities’Computes dimensionality of a list of SimpleUnits. Stores the dimensionality as a list of SimpleUnits as well, so we don't need a whole new type.V jinquantitiesNAdds two quantities. Second quantity is converted to units of first quantity.W jinquantitiesRSubtract two quantities. Second quantity is converted to units of first quantity.X jinquantities5Helper function used in addQuants and subtractQuants. NOPQRSTUVWX NOPQRSTUVWXSafed¦Y jinquantitiesaView the source code for this declaration to see what units and prefixes are defined by default.ÕThis string holds the definitions for units and prefixes. Base units are defined by the name of the unit, the name of the base in brackets, and any aliases for the unit after that, all separated by equal signs: meter = [length] = mg. Prefixes are defined by placing a dash after all identifiers, and providing a value for the prefix: milli- = 1e-3 = m-$. Other units are defined by using previously defined units in an expression: minute = 60 * second = min.şThe reason these definitions aren't placed in a text file is so you don't have to operate your whole program in the IO monad. Users can copy this file into their source and modify definitions, or simply add a few definitions to the end of this string.‹These definitions are taken almost verbatim from the Pint unit conversion library for the Python programming language. Check them out on  https://github.com/hgrecco/pintGitHub.YYSafe‡vZ jinquantitiesSimple type used for shorthand[ jinquantities4Alternate definition for spaces. Just actual spaces.\ jinquantities<Parse quantity expression; addition and subtraction allowed.] jinquantities¼Using already compiled definitions, parse expression. Also allows for expressions like "exp1 => exp2" in the middle, which converts the quantity exp1 into the units of the quantity exp2.^ jinquantities4Parser that accepts "=>" in between two expressions.j jinquantitiesGModification of addQuants to account for Either QuantityError Quantity.k jinquantitiesLModification of subtractQuants to account for Either QuantityError Quantity.l jinquantitiesLModification of multiplyQuants to account for Either QuantityError Quantity.m jinquantitiesJModification of divideQuants to account for Either QuantityError Quantity.n jinquantitiesModification of exptQuants to account for Either QuantityError Quantity. Returns error if dimensional quantity used in exponent.o jinquantities8Modification of parseSymbolNum to handle parsing errors.p jinquantities:Parses a symbol and then parses a prefix form that symbol.q jinquantitiesFParse a number and insert the given definitions into the CompoundUnit.r jinquantities6Parses out prefixes and aliases from quantity's units.s jinquantities:Parses prefix and alias, if applicable, from a SimpleUnit.t jinquantitiesGTry to parse a prefix from a symbol. Otherwise, just return the symbol.u jinquantities9Helper function for prefixParser that is a Parsec parser.v jinquantitiesšConverts string to a Quantity using an expression grammar parser. This parser does not parser addition or subtraction, and is used for unit definitions.€ jinquantities"Parse either a symbol or a number. jinquantitiesoParse a symbol with an optional negative sign. A symbol can contain alphanumeric characters and the character '_'.‚ jinquantities0Parent function for parseNum' to parse a number.ƒ jinquantitiesrMeat of number parser. Parse digits with an optional negative sign and optional exponential. For example, -5.2e4.„ jinquantitiesUParses just the exponential part of a number. For example, parses "4" from "-5.2e4".… jinquantities9Negate a number if the first argument is a negative sign.,Z[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…,[\Z]^_`abcdefighjklmnopqrstuvwxyz{|~}€‚ƒ„…Safe–Æ † jinquantitiesUParse multiline string of definitions (say, from a file) into a list of definitions.‡ jinquantitiesParsec parser for definitions.ˆ jinquantitiesParse any definition line‰ jinquantitiesCustom eol parsec parser.Š jinquantities@Parse a line containing unit definition Ex: minute = 60 s = min‹ jinquantities;Parses a unit definition. Example: foot = 12 in = ft = feetŒ jinquantities<Parses the synonyms at the end of a base or unit definition. jinquantities@Parse line containing base definition. Ex: meter = [length] = m jinquantities@Parse the base of a base definition. Example: [length] -> length jinquantities?Parse line containing prefix definition Ex: milli- = 1e-3 = m- jinquantitiesFParse the prefix part of a prefix definition. Example: yocto- -> yocto‘ jinquantities+Parse the synonyms for a prefix definition.’ jinquantitiesParse a symbol for a unit †‡ˆ‰Š‹Œ‘’ †‡ˆ‰Š‹Œ‘’Safe¤q“ jinquantitiesMonad used for addDefinition.” jinquantities#Convert string of definitions into ! structure. See source code for   for an example.• jinquantities¢Converts a list of definitions to the Definitions data structure. Modifies an emptyDefinitions object by combining the incremental additions of each Definition.– jinquantities»Add one definition to the definitions. Creates a new Definitions object using the information in the Definition, and then unions the Definitions in the state monad with this new object.— jinquantities"Computes intersection of two lists˜ jinquantitiesVariant of the DJB2 hash; *http://stackoverflow.com/a/9263004/1333514™ jinquantitiesœAdd a hash of the definitions string to a group of Definitions. Meant to be the last step, after definitions are created. Used for Definitions comparison.“”•–—˜™”“•–—˜™Safe¸\š jinquantities0Default set of definitions that come predefined.› jinquantities/Create a Quantity by parsing a string. Uses an > for undefined units. Handles arithmetic expressions as well.fromString "25 m/s"Right 25.0 meter / secondfromString "fakeunit"$Left (UndefinedUnitError "fakeunit")fromString "ft + 12in"Right 2.0 footŒThis function also supports unit conversions, by placing "=>" in between two valid expressions. This behavior is undefined (and returns a 5) if the quantity to be converted to has a magnitude.fromString "min => s"Right 60.0 secondfromString "2 ft + 6 in => ft"Right 2.5 footfromString "m => 3 ft""Left (ScalingFactorError 3.0 foot)9Make sure not to use dimensional quantities in exponents.fromString "m ** 2"Right 1.0 meter ** 2fromString "m ** (2s)"cLeft (ParserError "Used non-dimensionless exponent in ( Right 1.0 meter ) ** ( Right 2.0 second )")œ jinquantities*Create quantities with custom definitions.9let myDefString = defaultDefString ++ "\nmy_unit = 100 s"+let (Right d) = readDefinitions myDefString let myFromString = fromString' dmyFromString "25 my_unit"Right 25.0 my_unit jinquantities)Parse units from a string. Equivalent to fmap units . fromStringunitsFromString "N * s"Right newton secondš›œš›œSafe¸²! "89:NOTVWY”›œ› !"NOTVW89:œ”YŸ      !"#$%&''()**+,--./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^ _`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹Œ‘’“”•–—˜™š›œŸ ¡¢£¤¥*jinquantities-0.1.0-5hsy7NJT96yFmk5pM51u0VData.Quantities.DataData.Quantities.ConvertData.Quantities.DefaultUnitsData.Quantities.ExprParser Data.Quantities.DefinitionParserData.Quantities.DefinitionsData.Quantities.ConstructorsData.QuantitiesdefaultDefString Definitionsbasessynonyms unitsListprefixes prefixValuesprefixSynonyms unitTypes defStringHash DefinitionPrefixDefinitionBaseDefinitionUnitDefinition defPrefixfactor defSynonymsbasedimBase defSymbolquantityQuantityComputation QuantityErrorUndefinedUnitErrorDimensionalityErrorUnitAlreadyDefinedErrorPrefixAlreadyDefinedError ParserErrorDifferentDefinitionsErrorScalingFactorErrorQuantity magnitudeunits CompoundUnitdefssUnits SimpleUnitsymbolprefixpowerSymbol showCompUnit' showPower showPrettyNumunits'defs' baseQuantshowSort reduceUnits reduceUnits' removeZeros invertUnitsinvertSimpleUnitmultiplyQuants divideQuants exptQuantsemptyDefinitionsunionDefinitions$fShowSimpleUnit$fEqDefinitions$fShowCompoundUnit $fEqQuantity$fShowQuantity$fEqSimpleUnit$fOrdSimpleUnit$fShowDefinitions$fOrdDefinitions$fEqCompoundUnit$fOrdCompoundUnit $fOrdQuantity$fShowDefinition$fEqDefinition$fOrdDefinition$fShowQuantityError$fEqQuantityErrorconvert convertBaseconvert' convertBase'toBase simpleToBasedimensionalitydimensionality' addQuantssubtractQuants linearQuantsEQuantspaces'parseExprQuant parseExprparseConvertExpr parseExpr' parseTerm parseFactor parseExptparseNestedExpr parseExptOp parseTermOp parseFactorOpaddOpmulOpexptOp addEQuantssubtractEQuantsmultiplyEQuants divideEQuants exptEQuantsparseESymbolNum parseESymbol parseENumpreprocessQuantitypreprocessUnit prefixParser prefixParser' parseMultExprparseMultExpr'parseMultFactor parseMultExptparseMultNestedExprparseMultExptOpparseMultFactorOp mulMultOp exptMultOpexptMultQuants'parseSymbolNum parseSymbol'parseNum parseNum'parseExponential timesSignparseDefinitionsparseDefinitions'parseDefeol parseDefLine parseUnitDef parseSynonym parseBaseLine parseBaseparsePrefixLine parsePrefixparsePrefixSynonym parseSymbol DefineMonadreadDefinitionsmakeDefinitions addDefinition checkDefinedhashaddDefinitionsHashdefaultDefinitions fromString fromString'unitsFromStringGHC.Real/