COMP 302 Lecture Notes - Lecture 19: Type Inference, Type System, Empty Set

22 views7 pages

Document Summary

Contents (3 questions): higher-order function, answer is like 3 lines long. It has some recursion: recursive function on lists. One double sided sheet of notes -- can be written however small we want but no magnifying glass. To prepare, look at the solutions for assignments 1 and 2. We learned about type variables and type inference. We learnt how to figure out the types of variable with unannotated code. To goal was to make the most general guess consistent with the constraints. The same flexibility in the type system that allows you to have polymorphism is the same thing that lets you do type inference. We did the map example, though it was kind of confusing, as he wrote it like this: map = fun f -> fun l -> As we are more used to seeing stuff like this: map f l = The latter one is just training wheels" for those not used to seeing functions.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents