This is a note from the module organiser on CS141 Functional Programming: Module organisers regularly scan GitHub for commonalities between submitted assignments and publicly available code. You are reminded to follow the plagiarism policy included with CS141 coursework specifications and the University Regulation 11 (Academic Integrity). DO NOT replicate any portion of this repository, including pieces of code, in your own submitted work. DO NOT use GitHub Copilot or similar software to write chunks of your code, as it may reproduce this work without your knowing. And please cite any resources or information you have found helpful during the creation of your own work, which may include this repository. 🙂
The coursework itself can be found in the scratch-clone
directory.
You can try this locally using (once the io-extension
directory project has been started with stack run
):
My extension to this coursework (as well as implementing functions…) was to rewrite the (originally pure) interpreter to handle side effects in the program. The example used here is console IO, but could now take any other form!
You likely care about the interpreter itself the most.
The data types representing the language are in:
scratch-clone/src/Language.hs
The interpreter is implemented in:
scratch-clone/src/Interpreter.hs
Then, for the more advanced IO/side effects extension, you care about:
The updated language description, now including ‘built-in statements’ or BuiltinStmt
:
io-extension/src/Language.hs
The much-updated interpreter, re-written with more monads handling side effects inside the code:
io-extension/src/Interpreter.hs
Enter the project you want to build. Likely, this is the scratch-clone
directory.
The project is built and ran using stack
. Please install stack
!
Then, you should be able to simply:
stack build
You may run into errors. If so, run the following:
stack clean --full
stack update
stack upgrade
And retry the build.
Once done, you’re now free to run the server with:
stack run