%      Safe-InferredIView the source code for this declaration to see what units and prefixes  are defined by default. IThis string holds the definitions for units and prefixes. Base units are L 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] = m@. 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 N have to operate your whole program in the IO monad. Theoretically, a user of N this package can create their own definitions file or modify this one, but a  mechanism for doing so hasn't been created yet. JThese 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-Inferred,FHolds information about defined units, prefixes, and bases. Used when 5 parsing new units and performing units conversions. "Map from symbol to base units and # conversion factor to those units. *Map 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. (List 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. "'Hash of the definitions string used to ' create definitions. Defaults to -1 if ! modified or no string was used. #CData 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 y Returns Right 0.44704 meter / second  - computation :: QuantityComputation Quantity  computation = do  x <- fromString "BADUNIT"  convertBase x Returns Left (UndefinedUnitError BADUNIT) Custom error type 0Used when a scaling factor is present in a unit  conversion. -Used when two quantities come from different  Definitions. %Used when a string cannot be parsed. 4Used internally when defining units and a prefix is  already defined. 2Used internally when defining units and a unit is  already defined. 5Used when converting units that do not have the same 4 dimensionality (example: convert meter to second). -Used when trying to parse an undefined unit. $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 ** 2DData type to hold compound units, which are simple units multiplied  together. $&Definitions used to create the units. %(List of SimpleUnits that is interpreted ) as the units being multiplied together. &,Representation 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. ,CConvenience function to extract SimpleUnit collection from Quantity's  CompoundUnit. -9Convenience function to extract Definitions from Quantity's CompoundUnit. .;Convenience function to make quantity with no definitions. /*Sort units but put negative units at end. 0ACombines equivalent units and removes units with powers of zero. 1!Helper function for reduceUnits. 2@Removes 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 a double. 5#Default, empty set of definitions. 6#Combine two Definitions structures B7 !"#89:;<=>?@A B C$%&DEFG'(*+,-./0123456HIJKL=7 !"#89:;<=>?@A B C$%&DEFG'(*+,-./0123456 7 !"# >;8?@A<=A9:A  B C$%&DEFG'(*+,-./0123456HIJKL Safe-Inferred !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 quantity P-Converts a simple unit to its base quantity. %Computes dimensionality of quantity. &dimensionality <$> fromString "newton"#Right [length] [mass] / [time] ** 2Q=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. >Adds two quantities. Second quantity is converted to units of  first quantity. BSubtract two quantities. Second quantity is converted to units of  first quantity. R6Helper function used in addQuants and subtractQuants. MNOPQR MNOPQR MNOPQR Safe-InferredSSimple type used for shorthand T5Alternate definition for spaces. Just actual spaces. U=Parse quantity expression; addition and subtraction allowed. VFUsing 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. WParser that accepts => in between two expressions. XHModification of addQuants to account for Either QuantityError Quantity. YMModification of subtractQuants to account for Either QuantityError Quantity. ZMModification of multiplyQuants to account for Either QuantityError Quantity. [KModification of divideQuants to account for Either QuantityError Quantity. \IModification of exptQuants to account for Either QuantityError Quantity. 9 Returns error if dimensional quantity used in exponent. ]9Modification of parseSymbolNum to handle parsing errors. ^;Parses a symbol and then parses a prefix form that symbol. _GParse a number and insert the given definitions into the CompoundUnit. `-Parses out prefixes and aliases from quantity' s units. a;Parses prefix and alias, if applicable, from a SimpleUnit. bHTry to parse a prefix from a symbol. Otherwise, just return the symbol. c:Helper function for prefixParser that is a Parsec parser. dGConverts string to a Quantity using an expression grammar parser. This F parser does not parser addition or subtraction, and is used for unit  definitions. e#Parse either a symbol or a number. fDParse a symbol with an optional negative sign. A symbol can contain + alphanumeric characters and the character '_'. gParent function for parseNum' to parse a number. hGMeat of number parser. Parse digits with an optional negative sign and , optional exponential. For example, -5.2e4. iBParses just the exponential part of a number. For example, parses 4 from  -5.2e4. j:Negate a number if the first argument is a negative sign. ,STUVWklmnopqrstuXYZ[\]^_`abcdvwxyz{|}~efghij,STUVWklmnopqrstuXYZ[\]^_`abcdvwxyz{|}~efghij,STUVWklmnopqrstuXYZ[\]^_`abcdvwxyz{|}~efghij Safe-Inferred @Parse multiline string of definitions (say, from a file) into a  list of definitions. Parsec parser for definitions. Parse any definition line Custom 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 5Parse the base of a base definition. Example: [length] -> length (Parse line containing prefix definition  Ex: milli- = 1e-3 = m- GParse the prefix part of a prefix definition. Example: yocto- -> yocto ,Parse the synonyms for a prefix definition. Parse a symbol for a unit    Safe-InferredMonad used for addDefinition. #Convert string of definitions into  structure. See source  code for  for an example. KConverts a list of definitions to the Definitions data structure. Modifies K an emptyDefinitions object by combining the incremental additions of each  Definition. HAdd one definition to the definitions. Creates a new Definitions object M using the information in the Definition, and then unions the Definitions in ' the state monad with this new object. #Computes intersection of two lists Variant of the DJB2 hash;  *http://stackoverflow.com/a/9263004/1333514 IAdd a hash of the definitions string to a group of Definitions. Meant to G be the last step, after definitions are created. Used for Definitions  comparison.   Safe-Inferred1Default 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 foot9This function also supports unit conversions, by placing "=>" in between B two valid expressions. This behavior is undefined (and returns a I ScalingFactorError) 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):Make 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 . fromString unitsFromString "N * s"Right newton second Safe-Inferred        ! " #$%&'()*+,-./0123456789:;<=>?@A BCDE2FGHIJ/KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ quantities-0.3.0Data.QuantitiesData.Quantities.DefaultUnitsData.Quantities.DataData.Quantities.ConvertData.Quantities.ExprParser Data.Quantities.DefinitionParserData.Quantities.DefinitionsdefaultDefStringData.Quantities.Constructors DefinitionsQuantityComputation QuantityErrorScalingFactorErrorDifferentDefinitionsError ParserErrorPrefixAlreadyDefinedErrorUnitAlreadyDefinedErrorDimensionalityErrorUndefinedUnitErrorQuantity 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 invertUnitsinvertSimpleUnitemptyDefinitionsunionDefinitionsUnitDefinition defSymbolquantityBaseDefinitiondimBasePrefixDefinition defPrefixfactor defSynonymssymbolprefixpower$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