Download link:# A simple end-to-end test of the CSU34016 exercise system
Description
5/5 – (2 votes)
Prerequisites
-
Haskell
stackis installed on the machine you are using. -
You have also installed
makex1 -
Your current directory is the one containing this directory (
Exercise1)
Task
-
Open a command-line window and navigate to folder containing
Exercise1. -
Run ‘makex1’ and supply requested information.
This will add file Exercise1/src/Ex1.hs.
-
Navigate into
Exercise1. -
Enter
stack install. -
If this is your first time running
stackin one of the CSU34016 Exercise folders, you may have to wait whilestackensures it has access to the correct versions of both the Haskell compiler and libraries. This delay should only happen once. -
Eventually
stackwill compile and build and install the code. A lot of logging “stuff” will scroll past, ending with something like this:
“`
Copied executables to /Users/butrfeld/.local/bin:
– ex1
“`
- You can run the program by simply typing
ex1.
Right now this will fail with a message like:
“`
Running Exercise1
ex1: Prelude.undefined
CallStack (from HasCallStack):
error, called at libraries/base/GHC/Err.hs:79:14 in base:GHC.Err
undefined, called at src/Ex1.hs:5:9 in main:Ex1
“`
- Your task is to edit
src/Ex1.hsto implementf1so it computes the right result.
When it does, you should see something like:
“`
Running Exercise1
f1(11111111) = 11111153
“`
- To submit, simply upload only your revised
Ex1.hsfile to Blackboard.