-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | a minimal, extensible and precise calculator -- -- Hascal is a minimal calculator with infix-operations supporting -- addition, subtraction, division, multiplication, exponentiation and -- logarithming. Brackets are not supported yet. Futhermore, it's easy to -- add custom operators. @package hascal @version 1.1 -- | Hascal is both a simple but extendable calculator library for -- Haskell and a command-line program using it. -- -- Also, its source code is a nice example for a minimalistic Haskell -- project. module Hascal -- | operators is the default list of operators. -- -- An operator consists of one character and a function with of type -- CReal -> CReal -> CReal. -- -- operators includes: -- --
-- (a - b == c) == (a == b + c) -- (a / b == c) == (a == b * c) -- (a ? b == c) == (a == b ^ c) --operators :: [(Char, CReal -> CReal -> CReal)] -- | eval gets a list of operators and a string containing a -- mathematical expression/term which only uses those operators listed in -- the first argument, and returns the result of that term. eval :: [(Char, CReal -> CReal -> CReal)] -> String -> CReal -- | hascal is the default evaluator: -- --
-- hascal = eval operators --hascal :: String -> CReal