adamrk a7a06a7684 fix bug caused by incomplete pattern in precedence function
typing in a string like "4 + sqrt(5)" would cause a crash
because in the middle of typing "sqrt" the evaluator would
treat 's' as an operator and try to compare it's precedence
to the precedence of '+'. The precedence function did not
match all patterns and this adds an otherwise case.
2017-05-29 00:20:40 -04:00
2017-04-28 11:54:10 +02:00
2017-04-27 19:29:42 +02:00
2017-04-28 18:07:46 +02:00
2017-04-27 19:29:42 +02:00

bc

A better basic calculator. Like the original bc, but with a better prompt. Work in progress. Very incapable right now.

asciicast

What?

The idea behind bc is to display partial results to the right of the cursor in yellow while we type. A little example can be found in the video above. Minor syntactic cleanups have been developed as well (e.g. no local keyword). We have infinite precision integers and 90 decimal mantissa precision floats (similar to setting scale to 90).

We support all builtin functions, but have no IO (no print).

TODO

  • A good readline copy (haskeline is sadly out of the question for this project)
    • Add keyboard shortcuts
  • Comment parsing
  • Closures that can modify the parent environment (but do away with the local keyword).
  • Better arbitrary precision floats
Description
A Better Calculator
Readme 48 KiB
Languages
Haskell 99.9%