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.
32 lines
712 B
32 lines
712 B
# Chapter Excercises |
|
## Multiple choice |
|
1. (c) |
|
2. (b) |
|
3. (a) |
|
4. (c) |
|
5. (a) |
|
|
|
## Does it typecheck? |
|
see src/typecheck.hs |
|
|
|
## Given a datatype declaration, what can we do? |
|
1. Will not type check. `"chases"` is a `String` not a `Rocks` and `True` is of type `Bool`, not `Yeah` |
|
2. Will typecheck. |
|
3. Will typecheck. |
|
4. Will not typecheck, because `Papu` is not an instance of `Ord` |
|
|
|
## Match the types |
|
1. Can't be substituted |
|
2. Can't be substituted |
|
3. Can be substituted |
|
4. Can be substituted |
|
5. Can be substituted |
|
6. Can be substituted |
|
7. Can't be substituted |
|
8. Can't be substituted |
|
9. Can be substituted |
|
10. Can be substituted |
|
11. Can't be substituted |
|
|
|
## Type-Kwon-Do Two: Electric Typealoo |
|
see src/typekwondo.hs |