-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Utilities for parsing and evaluating mathematical expressions. -- -- ParserFunction provides utilities for parsing and evaluating -- mathematical expressions. The central parsing function in this package -- is stringToExpr, which parses a string-expression and returns -- a maybe expression tree. This tree is suitable for performing symbolic -- manipulation. Expressions can then be evaluated using the function -- evalExpr. If you wish to evaluate a string-expression without -- any intermediate operations, simply use the function -- evalString. Examples of these functions can be seen by -- viewing the source code of this module. @package ParserFunction @version 0.0.8 module Text.ParserCombinators.Parsec.ParserFunction -- | The Expr data type provides a basis for ordering mathematical -- operations. data Expr type Variable = String -- | evalString evaluates a string-expression using a list of -- variable definitions with values. evalString :: String -> [(Variable, Complex Double)] -> Maybe (Complex Double) -- | evalExpr evaluates an expression tree using a list of -- variable definitions with values. evalExpr :: Expr -> [(Variable, Complex Double)] -> Maybe (Complex Double) -- | stringToExpr parses a string-expression and returns a maybe -- expression tree. stringToExpr :: String -> Maybe Expr buildExpr :: Parser Expr -- | eval takes a map of variable definitions and values, and a -- maybe expression tree, to produce maybe a numerical value. eval :: Map Variable (Complex Double) -> Maybe Expr -> Maybe (Complex Double) instance Show Expr instance Eq Expr