This week’s homework is to extend a parser and interpreter for a simple calculator language. The starter code, which describes the initial language and provides an interpreter and parser, can be found here. The interpreter can be run by calling the
interpret function from Main.hs in ghci.
The homework is simply to extend the language by modifying the code; no new functions need to be written. Modifications should be made to
Parser.hs provides parsing functionality basically as implemented in lecture on Wednesday 2/6.
As currently implemented, the language consists of expressions like the following.
1 (- 4) (+ 1 2) (+ (-5) (* 1 2))
You should extend the parsers, language datatype, and
eval function to allow one or more arguments to
* instead of exactly two.
Send an email to firstname.lastname@example.org with either:
(Preferred) A link to a Gitlab / Github repository with your code.
A .zip file with your code.