Part 19

Quiz

Why can’t we map Nothing?

  1. Because Nothing doesn’t take arguments
  2. Because Nothing returns nothing
  3. Because Nothing is a constructor.

If we define data Boing = Frick String Boing (Int -> Bool), what is the type of Frick?

  1. Boing
  2. String -> Boing -> Int -> Bool -> Boing
  3. String -> Boing -> (Int -> Bool) -> Boing

If we define data ThreeLists a b c = ThreeLists [a] [b] [c], what is the type of the constructor ThreeLists?

  1. [a] -> [b] -> [c] -> ThreeLists
  2. a -> b -> c -> ThreeLists a b c
  3. [a] -> [b] -> [c] -> ThreeLists a b c
  4. [a] -> [b] -> [c] -> ThreeLists [a] [b] [c]

If we define data TwoLists a b = TwoList {aList :: [a], bList :: [b]}, what is the type of the function aList?

  1. aList is not a function, it is a field
  2. TwoLists a b -> [a]
  3. [a] -> TwoLists a b
  4. [a]
You have reached the end of this section!

You can check your current points from the blue blob in the bottom-right corner of the page.