mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
![]() I was hoping to add nested datatypes into the language, but it turns out doing so is quite tricky and not all that useful with Roc's current compilation model. Basically every implementation strategy I could think of ended up requiring a uniform representation for the data layout (or some ugly workaround). Furhermore it increased the complexity of the checker/mono IR generator a little bit - basically, we must always pass around the alias definitions of nested datatypes and instantiate them at usage sites, rather than being able to unroll aliases as we currently do during canonicalization. So, especially because we don't support polymorphic recursion anyway, I think it may be better to simply disallow any kind of nested datatypes in the language. In any case, Stephanie Weirich [seems to think nested datatypes are not needed](https://www.cis.upenn.edu/~plclub/blog/2020-12-04-nested-datatypes/). Closes #2293 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |