First class modules (was Existential Typing)

Tom Pledger
Fri, 2 Nov 2001 09:45:17 +1300

Simon Peyton-Jones writes:
 | A key design choice in our system is to use *nominal* not *structural*
 | typing.   The structural choice makes perfect sense, but it leads to
 | complications we don't have (as well as benefits).  So we don't have
 | structural subtyping, and it would not be easy to add it.
 | On the other hand, one could add nominal subtyping without too
 | much difficulty:
 | 	record A = { x,y :: Int }
 | 	record B <: A = { z :: Int }
 | We have not done that yet, but Mark thinks it would could be done
 | without bad interaction with what we have already.


Could a function of type A->Int be applied to an argument of type B?
That's arguably the most difficult part.