Quiz
Why can’t we map Nothing
?
-
Because
Nothing
doesn’t take arguments -
Because
Nothing
returns nothing -
Because
Nothing
is a constructor.
If we define data Boing = Frick String Boing (Int -> Bool)
, what is the type of Frick
?
-
Boing
-
String -> Boing -> Int -> Bool -> Boing
-
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
?
-
[a] -> [b] -> [c] -> ThreeLists
-
a -> b -> c -> ThreeLists a b c
-
[a] -> [b] -> [c] -> ThreeLists a b c
-
[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
?
-
aList
is not a function, it is a field -
TwoLists a b -> [a]
-
[a] -> TwoLists a b
-
[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.