calculator 0.3.0.1 → 0.3.0.2
raw patch · 3 files changed
+56/−6 lines, 3 files
Files
- README.md +50/−0
- calculator.cabal +4/−4
- src/Calculator/Help.hs +2/−2
+ README.md view
@@ -0,0 +1,50 @@+# Calculator++A calculator repl.++## Features++- Arithmetic+- Standard mathematical functions+- Variable bindings+- Function bindings+ - Single argument functions+ - Multiple argument functions+- Plotting (Optional)+ - Static plots (no animation)+ - Dynamic plots (for multiple argument functions)++## Installation and plotting support++The plotting support is optional as it requires `gtk2hs`. It is off by default, and can be turned on using a configuration as shown.++To install *without* plotting support.++```bash+$ cabal install calculator+```++To install *with* plotting support.++```bash+$ cabal install calculator --flags="plot-gtk-ui"+```++## TODO++ Lots and lots of testing.++## Implementation++* Written in haskell+* Parsing done using [parsec](https://hackage.haskell.org/package/parsec)+* Repl built using [haskeline](https://hackage.haskell.org/package/haskeline)+* Colored output using ANSI color codes++## Usage++ Use :? to view usage instructions.++## Thanks++* Thanks to [husky](https://github.com/markusle/husky) for color output.
calculator.cabal view
@@ -1,12 +1,12 @@ name: calculator-version: 0.3.0.1-synopsis: A calculator repl.+version: 0.3.0.2+synopsis: A calculator repl, with variables, functions & Mathematica like dynamic plots. description: A calculator repl that processes mathematical expressions. Does basic arithmetic, and provides pre-defined basic mathematical functions. . Provides binding functionality for variables and functions. .- Optionally provides plotting support.+ Optionally provides plotting support (configure using cabal). homepage: https://github.com/sumitsahrawat/calculator license: GPL-2 license-file: LICENSE@@ -15,7 +15,7 @@ -- copyright: category: Math build-type: Simple--- extra-source-files: +extra-source-files: README.md cabal-version: >=1.10 flag plot-gtk-ui
src/Calculator/Help.hs view
@@ -18,10 +18,10 @@ 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\""+ , " :func f(x,y)=x+y -- Binds f(x, y) to \"x + y\"" , " :reset -- Reset variable and function bindings" #ifdef PLOT- , " :plot -- For plotting, detailed below"+ , " :plot -- For plotting (detailed below)" #endif , " :show -- Display all variable bindings" , " :? or :help -- Display this help message"