mathexpr-0.3.1.0: Parse and evaluate math expressions with variables and functions
Safe HaskellSafe-Inferred
LanguageHaskell2010

Numeric.MathExpr

Synopsis

Documentation

evaluate :: Settings -> String -> [(String, Double)] -> Double Source #

Evaluate an expression Example: `evaluate def "x + y ^ 2" [("x", 1), ("y", 2)]

data Settings Source #

Operators are in the form (character, precedence, function) Example: (+, 0, (+)), ('', 1, ()) (higher the precedence, the sooner the operator operates)

Functions are in the form (name, function) Example: ("ln", log)

Constructors

Settings 

Fields

Instances

Instances details
Default Settings Source # 
Instance details

Defined in Numeric.MathExpr

Methods

def :: Settings #

defaultFunctions :: [([Char], Double -> Double)] Source #

Functions are in the form (name, function) Example: ("ln", log)

defaultOperators :: [(Char, Int, Double -> Double -> Double)] Source #

Operators are in the form (character, precedence, function) Example: (+, 0, (+)), ('', 1, ()) (higher the precedence, the sooner the operator operates)