COMP 3007 Lecture Notes - Lecture 2: Third Order

72 views4 pages

Document Summary

However, so does (\x->x) :: bool -> bool. In general, a type may have type variables e. g. r, s and t, in it. (this is similar to generic types in other languages. ) A type t" is an instance of a type t if it results from a substitution of types for some, or all, of the type variables of t. Ignoring type classes for now, if e has a type t and t" is an instance of t then e has type t". E. g. (\x y -> x) :: s -> t -> s (\x y -> x) :: integer -> t -> integer (\x y -> x) :: integer -> (string, string) -> integer. An expression e has principal type t if 1) e has type t, and 2) for any type t" where e has type t", t" is an instance of t. If e has a type then e has a principal type.

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