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