Haskell Functions Collaborative Learning Exercise #3 CSC 372 January 22, 2018 Time: 8 minutes; Points: 3

Problems

  1. Define a function min3 that computes the minimum of three values. Example:
    > min3 5 2 10
    2
    
    Note: The Prelude has a min function. You do not need nor do you know Haskell's if-else!
  2. What is the type of min3?
  3. What are three types that min3 can be used with?
  4. Based on the exercise we just did on slide 82, consider the following expression
    f 1 g(h) 2 * a 3 b(4) + x y
    
    and
    1. Fully parenthesize it to show the order of operations
    2. Write some code to precede it such that its value is 203

Deliverable (per table)

Create a plain text file named cle3.txt with

  • A whitepace separated list of NetIDs for all tablemates
  • Answers for all the questions above.

    Submit it on lectura with turnin:

    turnin 372-cle3 cle3.txt