Skip to content

Instructions

Basics

Homeworks will be posted on Canvas after class the day they are assigned, and they will be due before class on the due date. Each homework will have two parts: a programming exercise, and a written component. You should upload your homework in a single zip file, including source code (the whole Cabal or Cargo project) for the programming part and a single document (.pdf, or a scanned image) for the written part.

While not required, we highly recommend you typeset your homeworks in LaTeX; we are happy to help you get started.

Submitting Assignments: Haskell

In a terminal, navigate to the directory that contains the assignment files. Run cabal v2-sdist -o . to generate a tarball in the current working directory titled hwn-0.1.0.0.tar.gz where n is the homework number. Upload this tarball to the appropriate assignment on Canvas. Please do not generate your own tarball or zipfile as this will interfere with the grading of your assignment and may result in a deduction of points.

Submitting Assignments: Written

Upload a single PDF of your written assignment to Canvas. You may upload either a PDF compiled using LaTeX (preferred) or a scan of your written assignment. If scanning your handwritten assignment, please combine all of the pages into a single PDF.

Grading

The programming portion is worth 100 points, and the written portion is worth 30 points. We will give partial credit for solutions that make substantial progress.

Programming Assignments

The programming assignments will give you hands-on experience working in Haskell and Rust. We will give you a source file with some parts deleted, and you will have to complete the code according to the instructions in the comments. Do not change the code we have provided.

If the problems are unclear or you are uncertain about some edge case, please ask on Piazza.

We will give you a basic driver and some tests to try out on your code, but we highly recommend you write your own tests. We will evaluate your programming assignments using our own test suites, and we will deduct points if tests fail. We will also look at your code manually.

Style definitely counts: write clean code. Style guides for Haskell or Rust are a good place to learn about conventions.

Fix warnings, lint code!

In both Haskell and Rust, your code should compile without warnings or errors.

  • Haskell: Run GHC with -Wall -Werror flags before submitting to check for warnings. Also, run hlint on your code and try to follow its suggestions. Warning: rarely, the suggestions may break your code (in which case you can obviously ignore them). Always check to see if things still work.
  • Rust: Run rustfmt on your source code to format it properly.

Written Assignments

The written assignments will give you practice working with models of programming languages. We will not be doing any proofs in this class, but we will evaluate your solutions with the following points in mind (not necessarily in this order):

  • Correctness: does the solution do what it should?
  • Completeness: are all cases considered?
  • Simplicity: is the solution simple?

We are not expecting long submissions---if your answers are more than a few pages in total, you should come talk to us.

Collaboration Policy

The collaboration policy for this course is very simple. You are free to discuss the homework problems with others, provided you adhere to the following three rules:

  1. Do not take make any records of your discussions. For instance, you may work on the board or on a piece of paper, but you should not take any photos, keep any notes, etc.
  2. Write up your homework individually. You should be able to reconstruct your assignment from scratch, given just the language documentation.
  3. Indicate who you have discussed the homework with at the top of your solutions.

If you follow these three rules, you will be completely fine. If, however, we find that several homeworks are too similar, we may ask students to explain their submissions to us individually.

If you can't explain why your solution works, we don't care if it behaves perfectly. We will give you a zero.

Outside Sources

We encourage you to use Haskell and Rust documentation, look up functions on Hoogle, etc. You should not:

  • Google for solutions to homework problems.
  • Ask for homework help on online, e.g., #haskell, #rust, Reddit, Discords, etc.
  • Post on sites like Quora, StackExchange, etc.

The Bottom Line

If you are unsure about whether a source is permissible, or if you are falling behind in the course and feel a strong temptation to bend these rules, please come talk to us instead.