Chapter 5:Semantic Analysis

 

In the above example p is taken as a type variable. Later on we see that p^ is used. Since operator ^ takes pointer to an object and returns the object, this implies that p must be pointer to an object of some unknown type a . Thus, the type expression of the function deref is pointer( a ) a for any type of object a . Similarly, if we had an identity function in some weakly typed language then its type would have been a a , for any type of object a .