jinquantities-0.1.1: Unit conversion and manipulation library.

Safe HaskellSafe
LanguageHaskell2010

Data.Quantities.Definitions

Description

This module builds a Definitions object from a string.

Synopsis

Documentation

readDefinitions :: String -> Either (QuantityError Double) Definitions Source #

Convert string of definitions into Definitions structure. See source code for defaultDefString for an example.

type DefineMonad = StateT Definitions (Either (QuantityError Double)) Source #

Monad used for addDefinition.

makeDefinitions :: [Definition] -> Either (QuantityError Double) Definitions Source #

Converts a list of definitions to the Definitions data structure. Modifies an emptyDefinitions object by combining the incremental additions of each Definition.

addDefinition :: Definition -> DefineMonad () Source #

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.

checkDefined :: [Symbol] -> [Symbol] -> [Symbol] Source #

Computes intersection of two lists

addDefinitionsHash :: String -> Definitions -> Definitions Source #

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.