mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-22 22:15:02 +00:00
![]() There are times that multiple concrete types may appear in unspecialized lambda sets that are being unified. The primary case is during monomorphization, when unspecialized lambda sets join at the same time that concrete types get instantiated. Since lambda set specialization and compaction happens only after unifications are complete, unifications that monomorphize can induce the above-described situation. In these cases, - unspecialized lambda sets that are due to equivalent type variables can be compacted, since they are in fact the same specialization. - unspecialized lambda sets that are due to different type variables cannot be compacted, even if their types unify, since they may point to different specializations. For example, consider the unspecialized lambda set `[[] + [A]:toEncoder:1 + [B]:toEncoder:1]` - this set wants two encoders, one for `[A]` and one for `[B]`, which is materially different from the set `[[] + [A, B]:toEncoder:1]`. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |