Lecture 4 Notes

The rest of the program is the client of the

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t also extends the local type environment, to follow the correct scoping. Each expression is evaluated in an empty substitution, so type inference is possible only within a expression. We call , as we did above, to expand the type variables in the substitution returned by .  ¡ £ ¦   ¢ £   % ¥¡ ¤ ¦  ¢&¡ £ ¢¡£¢¦ ¥£ ¦¤¡   ¡ £ All that’s left is to compare the actual and expected types of each module, using the procedure . We think of as “subtype”. We will define subtyping so that if type t1 is a subtype of a type t2 then every value of type t1 can be used as a value of t2 . This principle will apply not just to ordinary types, but to module types as well. For example " ¥£¡ ¡ % £ ¡ ¤¢ " © ¢ ¢ £ © !¥ " $ 1£ © " ¡ ¡£ ¦  ¡ © ¤¦¢&¡ £ ¢ " £  " $ 1£ © " £ © #¥  ¡¡ $ £ © " ¢ " £ ©  " £ © #¥ " " $ 1£ © " ¡ ¡ " ¡ ¥ since any module value satisfying the i...
View Full Document

This document was uploaded on 03/17/2014 for the course CSG 111 at Northeastern.

Ask a homework question - tutors are online