{-  
    COMS 4995: Parallel Functional Programming, Fall 2025
    Quiz 1: Haskell basics

    1. Close all devices (phone/laptop, etc). Make sure you have an index card to write on, and a pen/pencil.

    2. PLEASE WRITE YOUR NAME AND UNI AS LEGIBLY AS POSSIBLE

    3. Read the quiz question below, and write your answer on your index card. CIRCLE YOUR ANSWER.

    4. Turn in your card at the table in the front of the room.
-}

-- Consider the `foo` function defined below
foo :: [Int] -> Int
foo [] = 0
foo (x:xs)
    | x > y     = x
    | otherwise = y
    where
        y = foo xs

-- QUESTION:
-- What is the result of `foo [5, 11, 7, -4, 2]`?

-- CORRECT ANSWER:
-- 11

-- EXPLANATION:
-- foo finds the maximum element of a list of integers,
-- or 0 if all elements are negative