3 ms·
> For example if a function needs to take a record containing x as a field with type int, it should also accept a record with y as a field that it does not use.
by paldepind2 2y ago
> For example if a function needs to take a record containing x as a field with type int, it should also accept a record with y as a field that it does not use.
Not sure if I misunderstand what you mean, but this does not require subtyping. One of the key distinguishing features of row polymorphism is that exactly this can be achieved without subtyping. The extra unused fields (`y` in your example) are represented as a polymorphic type variable _instead_ of using subtyping. See for instance page 7 in these slides: https://www.cs.cmu.edu/~aldrich/courses/819/slides/rows.pdf https://www.cs.cmu.edu/~aldrich/courses/819/slides/rows.pdf
- deleted 2y ago[deleted]