/FP-Haskell

Primary LanguageHaskell

Homework

40+ various Haskell study tasks that I spent ~80 hours on. Tasks - https://github.com/GrandArchTemplar/Fp2020R3495/blob/main/hw1.md.

Coursework

I spent ~24 hours on.

Arithmetic parser that is capable of calculating values of expressions.

To start the program, call the "calculator" function, which works interactively and ends when you type "q" instead of expression.

Features of the parser (ver.3):

  • binary operators +, -, *, /, ^;
  • unary operators +, -;
  • parentheses;
  • functions cos, sin, ln;
  • constants pi, e;
  • variable x, whose value must be set separately;
  • ignores whitespaces;
  • error handling.

Easy to add the following features:

  • any binary operators;
  • any unary operators;
  • functions of one (and several too) variable;
  • any constants;
  • support of more than one variable.

Ver.1 doesn't support left-associative operators like "/".

Ver.1 and ver.2 don't support specifying associativity and precedence of operators.