Does anyone know the difference between Types
in crates/compiler/types/src/types.rs and Content
in crates/compiler/types/src/subs.rs?
I found this clue... in the docs for Types
/// Memory-dense storage of canonicalized types, sitting between the user-facing type syntax and
/// the [type solving representation][crate::subs::Content] of types.
Can we have a single representation now or do they need to be different for some reason?
The only thing I can think of is maybe the Can version needs to keep Region information around for error reporting
Note to self -- I'd like to try unifying these and use the single representation. Also SoA using Idx
's would be nice.
@Sam Mohr -- thinking about the TypeId
(from Rust's VarStore
) and moved into the SoloEnv. Here's a commit from my WIP type-check PR https://github.com/roc-lang/roc/pull/7608/commits/15df5fa2007c20b0724aae48b0457abd587bd113
We can migrate it into CombinedEnv also to be used in later stages when we want to generate a unique id.
Sounds good. We'll want to put that back as just ModuleEnv though since we aren't doing module sets anymore, it'll just be the same env the whole way through
Oh nice... no need to change then
A single ModuleEnv was much easier to understand
Last updated: Jul 06 2025 at 12:14 UTC