Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Type theorists have been talking about this too. The search term is "rows" or "row polymorphism". They're awesome but no mainstream language uses rows. I wrote about them in my blog post about 4 issues facing functional programming [0]. Also, check out Unison [1], which is mostly structural but "pretends" to be nominal in a way that I feel would be very appealing to most programmers.

[0]: https://chadnauseam.com/coding/pltd/four-issues-facing-fp

[1]: https://www.unison-lang.org/



OCaml has row polymorphism. The syntax for a function that prints `name` from a record that has `name` and possibly other fields is:

    val print_name: <name: string; ..> −> unit




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: