-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | tiny calculator library and command-line program -- -- a library and a command-line program for calculating numeral -- expressions with infix operators and constants but without -- parantheses. @package hascal @version 3.0.1 -- | Hascal is a simple, minimalistic, tiny calculator library and program. -- -- -- -- The hascal executable program is easy to use. In a shell, type: -- --
--   >>> hascal 1+2-3*4/5^6?7
--   -1.7263530417152033
--   
-- -- Given a configuration, the hascal function similarly evaluates -- an expression of type String. In a Haskell interpreter like -- GHCI, type: -- --
--   >>> hascal def "1+2-3*4/5^6?7"
--   Right (0.2736469582847967 :+ 0.0)
--   
-- --
--   >>> hascal def "1++2"
--   Left "Error at \"\"."
--   
module Hascal -- | A configuration. def is the default configuration. data Config t Config :: [Operator t] -> [Constant t] -> Config t -- | A list of operators. The order in this list also determines the order -- of evaluation. [operators] :: Config t -> [Operator t] -- | A list of constants. [constants] :: Config t -> [Constant t] -- | A class for types with a default value. class Default a -- | The default value for this type. def :: Default a => a -- | Given a configuration and a String-expression, returns -- Either a String containing an error message; or a -- Complex number. hascal :: (Read t, RealFloat t) => Config t -> String -> Result t -- | Given a configuration and a String-expression, returns a -- String containing the error message or the resulting complex -- number. showHascal :: (Show t, Read t, RealFloat t) => Config t -> String -> String -- | Show a Complex number a little bit more human-readable by -- matching both the real and the imaginery part against zero and one. showNumber :: (Show t, RealFloat t) => Complex t -> String instance (GHC.Read.Read t, GHC.Float.RealFloat t) => Data.Default.Class.Default (Hascal.Config t)