Halgebra 2.0

This week’s assignment is to update your computer algebra solver from Homework #3 to use GADTs to eliminate the need for error. This is done by adding a new Step 0 to the procedure that you followed in Homework #3: convert the Equation to the new LEquation type that allows only linear equations. The type is declared in the LArith module I have provided.

Here are the relevant modules:

The bundle of modules includes a Main module. This is not part of the assignment, but using it, you can say ghc Main at the command-line, and GHC will build an executable Main for you that you can use to solve equations.

If it’s helpful, the solution to the last Halgebra assignment is on Moodle.

Portfolio guidelines

Here is the breakdown of the functions you have been asked to write for your type-level portfolio:

This adds up to:

The total here is 99 points, but the goal isn’t to get to 100. Throwing out the unreasonable problems gives us 64. Arriving at a power of 2 at this point is auspicious. (It certainly wasn’t planned!) Here are the point values and how much, roughly, they are worth on the 4.0-point scale:

As always, do let me know if you have any questions.