Learning Module 4 — Interpreters and Expressions
Why this is important: The first step to learning to write an interpreter involves creating an appropriate data type and writing an evaluator. Being able to process simple expressions will enable you to add more flexibility to your own software.
Outcomes
- 4.1 – Given an implementation of
eval
, write a corresponding data type. (2 points) - 4.2 – Given an implementation of
eval
, write a lifting function to allow Haskell functions to be used by the interpreter. (4 points) - 4.3 – Given a datatype and semantics, write a clause of
eval
forif
expressions, binary operations, orlet
expressions. (4 points)