Haskell Project Style Guide

CS 1323 Honors, Fall 1996

Review this guide for each new project.
New requirements emerge as projects increase in complexity.

Project Document Requirements

Standards for Haskell Scripts

Literate Haskell Scripts

Type Specifications in Haskell Scripts

Each definition in a Haskell script must be accompanied by a specification giving the type of the entity being defined. For example, if you were defining a function to deliver a sequence consisting of the square, cube, and fourth power of a number of type Float, supplied as and argument, the definition might look like this:
somePowers :: Float -> [Float]
somePowers x = [x*x, x*x*x, x*x*x*x]
Or, if you were defining a variable of type Int, your definition might look like this:
numberOfTerms :: Float
numberOfTerms = 50

Standards for Session Transcripts

Most projects require you to turn in a transcript of a session in which you use Hugs. You generate such a session by issuing the command "script" to Unix before issuing the command "hugs", then pressing "control-D" upon exiting from Hugs.

These actions produce a file named "typescript" containing a transcript of the Hugs session. Such files contain backspace characters, which make the print-out look ugly in spots. Before printing the typescript file, reissue the command "hugs", load the script "removeBS.hs" and issue the command "main" to Hugs. This command will write file named "typescript.cln" in which the backspaces have be interpreted properly. This file contains no unsightly backspaces. Print it instead of the raw transcript file.

Obtain a copy of the Haskell script "removeBS.hs" by following the procedure described in Step 2 of Individual Project 1 for downloading software from the Supplied Software page on the CS1323 Web site.

Explain (handwritten annotations on the transcript) what aspects of the function's behavior are illustrated by each of your choices of demonstration examples. The CS1323h Web site provides an example of such annotations.

Last Modified: