RE: First class modules (was Existential Typing)

| artificial restriction. I think extending the system with | some form of | subtyping between records would be important for a usable | system. Your | paper suggested that you are planning to do this. Any | thoughts on current | ideas in this direction? Yes, we should really say something about this in the paper. 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. Simon

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. Hi. Could a function of type A->Int be applied to an argument of type B? That's arguably the most difficult part. Regards, Tom
participants (2)
-
Simon Peyton-Jones
-
Tom Pledger