calculator-0.2.0.3: src/Calculator/Help.hs
module Calculator.Help (help) where
--------------------------------------------------------------------------------
import Calculator.Color (bold)
import Calculator.Prim.Definitions (binaryOps, defFuns, defVars)
--------------------------------------------------------------------------------
import Data.List (intercalate, intersperse)
--------------------------------------------------------------------------------
help :: [String]
help = [ bold "Commands:"
, " :var x=pi -- Binds x to pi"
, " :func f(x)=x+1 -- Binds f(x) to \"x + 1\""
, " :func f(x,y)=x+y -- Binds f(x) to \"x + y\""
, " :reset -- Reset variable and function bindings"
, " :show -- Display all variable bindings"
, " :? or :help -- Display this help message"
, bold "Supported Operations: " ++ intersperse ' ' (map fst binaryOps)
, bold "Pre-defined variables: " ++ intercalate ", " (map fst defVars)
, bold "Provided Functions: "
, " " ++ intercalate ", " (map fst defFuns)
]
--------------------------------------------------------------------------------