Safe Haskell | Safe |
---|---|

Language | Haskell2010 |

This module builds a Definitions object from a string.

## Synopsis

- readDefinitions :: String -> Either (QuantityError Double) Definitions
- type DefineMonad = StateT Definitions (Either (QuantityError Double))
- makeDefinitions :: [Definition] -> Either (QuantityError Double) Definitions
- addDefinition :: Definition -> DefineMonad ()
- checkDefined :: [Symbol] -> [Symbol] -> [Symbol]
- hash :: String -> Int
- addDefinitionsHash :: String -> Definitions -> Definitions

# 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.

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.