'     SafeaView 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.Safe,zHolds information about defined units, prefixes, and bases. Used when parsing new units and performing units conversions.DMap from symbol to base units and conversion factor to those units.PMap from alias to symbol. Symbols without aliases are present as identity maps.]List of all units (no aliases). Used in prefix parser, and to detect duplicate definitions.gList of all prefixes (no aliases). Used in prefix parser, and to detect duplicate prefix definitions."Multiplicative factor of prefixes.  Map from prefix alias to prefix.!$Map from base symbols to unit types."nHash of the definitions string used to create definitions. Defaults to -1 if modified or no string was used.#]Data type for the three definition types. Used to hold definitions information when parsing.%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)Custom error type,Used when trying to parse an undefined unit.hUsed when converting units that do not have the same dimensionality (example: convert meter to second).CUsed internally when defining units and a unit is already defined.EUsed internally when defining units and a prefix is already defined.$Used when a string cannot be parsed. :Used when two quantities come from different Definitions. <Used when a scaling factor is present in a unit conversion. #Combination of magnitude and units.  Numerical magnitude of quantity.$magnitude <$> fromString "100 N * m" Right 100.0 Units associated with quantity. units <$> fromString "3.4 m/s^2"Right meter / second ** 2NData type to hold compound units, which are simple units multiplied together.$%Definitions used to create the units.%PList of SimpleUnits that is interpreted as the units being multiplied together.&ERepresentation of single unit. For example: "mm^2" is represented as >SimpleUnit { symbol = "meter", prefix = "milli", power = 2.0 }':String representation of a unit. Examples: "meter", "foot"(%Show a single unit, but prepend with ) if negative*"Removes decimal if almost integer.+?Will be used when we allow pretty printing of fractional units.,TConvenience function to extract SimpleUnit collection from Quantity's CompoundUnit.-IConvenience function to extract Definitions from Quantity's CompoundUnit..:Convenience function to make quantity with no definitions./)Sort units but put negative units at end.0@Combines equivalent units and removes units with powers of zero.1 Helper function for reduceUnits.2NRemoves units with powers of zero that are left over from other computations.3+Negate the powers of a list of SimpleUnits.4)Inverts unit by negating the power field.Multiplies two quantities.Divides two quantities.(Exponentiates a quantity with an integer5"Default, empty set of definitions.6"Combine two Definitions structuresB7 !"#89:;<=>?@A B C$%&DEFG'(*+,-./0123456HIJKL=7 !"#89:;<=>?@A B C$%&DEFG'(*+,-./0123456 7 !"# 8<?9:;=>;@A; B C$%&DEFG'(*+,-./0123456HIJKLSafe  Convert quantity to given units.3convert <$> fromString "m" <*> unitsFromString "ft"$Right (Right 3.280839895013123 foot)%Convert a quantity to its base units.#convertBase <$> fromString "newton"%Right 1000.0 gram meter / second ** 2M Convert quantity to given units.N%Convert a quantity to its base units.O.Converts a composite unit to its base quantityP,Converts a simple unit to its base quantity.$Computes dimensionality of quantity.&dimensionality <$> fromString "newton"#Right [length] [mass] / [time] ** 2QComputes 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.NAdds two quantities. Second quantity is converted to units of first quantity.RSubtract two quantities. Second quantity is converted to units of first quantity.R5Helper function used in addQuants and subtractQuants. MNOPQR MNOPQR MNOPQRSafeSSimple type used for shorthandT4Alternate definition for spaces. Just actual spaces.U<Parse quantity expression; addition and subtraction allowed.VUsing 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.W4Parser that accepts "=>" in between two expressions.XGModification of addQuants to account for Either QuantityError Quantity.YLModification of subtractQuants to account for Either QuantityError Quantity.ZLModification of multiplyQuants to account for Either QuantityError Quantity.[JModification of divideQuants to account for Either QuantityError Quantity.\Modification of exptQuants to account for Either QuantityError Quantity. Returns error if dimensional quantity used in exponent.]8Modification of parseSymbolNum to handle parsing errors.^:Parses a symbol and then parses a prefix form that symbol._FParse a number and insert the given definitions into the CompoundUnit.`6Parses out prefixes and aliases from quantity's units.a:Parses prefix and alias, if applicable, from a SimpleUnit.bGTry to parse a prefix from a symbol. Otherwise, just return the symbol.c9Helper function for prefixParser that is a Parsec parser.dConverts string to a Quantity using an expression grammar parser. This parser does not parser addition or subtraction, and is used for unit definitions.e"Parse either a symbol or a number.foParse a symbol with an optional negative sign. A symbol can contain alphanumeric characters and the character '_'.g0Parent function for parseNum' to parse a number.hrMeat of number parser. Parse digits with an optional negative sign and optional exponential. For example, -5.2e4.iUParses just the exponential part of a number. For example, parses "4" from "-5.2e4".j9Negate a number if the first argument is a negative sign.,STUVWklmnopqrstuXYZ[\]^_`abcdvwxyz{|}~efghij,STUVWklmnopqrstuXYZ[\]^_`abcdvwxyz{|}~efghij,STUVWklmnopqrstuXYZ[\]^_`abcdvwxyz{|}~efghijSafe UParse multiline string of definitions (say, from a file) into a list of definitions.Parsec parser for definitions.Parse any definition lineCustom eol parsec parser.@Parse a line containing unit definition Ex: minute = 60 s = min;Parses a unit definition. Example: foot = 12 in = ft = feet<Parses the synonyms at the end of a base or unit definition.@Parse line containing base definition. Ex: meter = [length] = m@Parse the base of a base definition. Example: [length] -> length?Parse line containing prefix definition Ex: milli- = 1e-3 = m-FParse the prefix part of a prefix definition. Example: yocto- -> yocto+Parse the synonyms for a prefix definition.Parse a symbol for a unit   SafeMonad used for addDefinition.#Convert string of definitions into ! structure. See source code for  for an example.Converts a list of definitions to the Definitions data structure. Modifies an emptyDefinitions object by combining the incremental additions of each Definition.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."Computes intersection of two listsVariant of the DJB2 hash; *http://stackoverflow.com/a/9263004/1333514Add 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. Safe0Default set of definitions that come predefined./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 footThis 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 )")*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)Parse units from a string. Equivalent to fmap units . fromStringunitsFromString "N * s"Right newton secondSafe        ! " #$%&'()*+,-./0123456789:;<=>?@A BCDEF2GHIJ/KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ quant_8Z8dUMmj0hU58UKuwMlUFqData.QuantitiesData.Quantities.DefaultUnitsData.Quantities.DataData.Quantities.ConvertData.Quantities.ExprParser Data.Quantities.DefinitionParserData.Quantities.DefinitionsdefaultDefStringData.Quantities.Constructors DefinitionsQuantityComputation QuantityErrorUndefinedUnitErrorDimensionalityErrorUnitAlreadyDefinedErrorPrefixAlreadyDefinedError ParserErrorDifferentDefinitionsErrorScalingFactorErrorQuantity magnitudeunits CompoundUnitmultiplyQuants divideQuants exptQuantsconvert convertBasedimensionality addQuantssubtractQuantsreadDefinitions fromString fromString'unitsFromStringbasessynonyms unitsListprefixes prefixValuesprefixSynonyms unitTypes defStringHash DefinitiondefssUnits SimpleUnitSymbol showCompUnit'baseGHC.Real/ showPower showPrettyNumunits'defs' baseQuantshowSort reduceUnits reduceUnits' removeZeros invertUnitsinvertSimpleUnitemptyDefinitionsunionDefinitionsPrefixDefinition defPrefixfactor defSynonymsBaseDefinitiondimBaseUnitDefinition defSymbolquantitysymbolprefixpower$fEqDefinitions $fEqQuantity$fShowQuantity$fShowCompoundUnit$fShowSimpleUnitconvert' convertBase'toBase simpleToBasedimensionality' linearQuantsEQuantspaces'parseExprQuant parseExprparseConvertExpr addEQuantssubtractEQuantsmultiplyEQuants divideEQuants exptEQuantsparseESymbolNum parseESymbol parseENumpreprocessQuantitypreprocessUnit prefixParser prefixParser' parseMultExprparseSymbolNum parseSymbol'parseNum parseNum'parseExponential timesSign parseExpr' parseTerm parseFactor parseExptparseNestedExpr parseExptOp parseTermOp parseFactorOpaddOpmulOpexptOpparseMultExpr'parseMultFactor parseMultExptparseMultNestedExprparseMultExptOpparseMultFactorOp mulMultOp exptMultOpexptMultQuants'parseDefinitionsparseDefinitions'parseDefeol parseDefLine parseUnitDef parseSynonym parseBaseLine parseBaseparsePrefixLine parsePrefixparsePrefixSynonym parseSymbol DefineMonadmakeDefinitions addDefinition checkDefinedhashaddDefinitionsHashdefaultDefinitions