You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
544 B
18 lines
544 B
7 years ago
|
# Exercises: The Quad
|
||
|
# Exercise 1
|
||
|
`Either` is a sum type, so `eQuad` has `4 + 4 = 8` inhabitants.
|
||
|
|
||
|
# Exercise 2
|
||
|
`(,)` is a product type, so `prodQuad` has `4 * 4 = 16` inhabitants.
|
||
|
|
||
|
# Exercise 3
|
||
|
`(->)` is an exponential type, so `funcQuad` has `4 ^ 4 = 256` inhabitants.
|
||
|
|
||
|
# Exercise 4
|
||
|
`(,,)` is a product type, so `prodTBool` has `2 * 2 * 2 = 8` inhabitants.
|
||
|
|
||
|
# Exercise 5
|
||
|
`(->)` is an exponential type, so `gTwo` has `(2 ^ 2) ^ 2 = 16` inhabitants.
|
||
|
|
||
|
# Exercise 6
|
||
|
`(->)` is an exponential type, so `fTwo` has `(4 ^ 4) ^ 2 = 65536` inhabitants.
|