What is a generic environment in Hylo?
mainIn Hylo, a generic signature is a set of generic parameter declarations and their associated constraints. To make sense of these signatures, the compiler constructs a generic environment.
A generic environment is a set of axioms used by the type system to prove properties about type or value terms. For example, if a signature constrains a type T to conform to Collection, the environment allows the compiler to prove that T.Element exists and has certain members (like infix+).
Key points:
- Trait declarations also define generic environments. All traits include an implicit
Selfparameter. - Constraints on associated types and values add further axioms to the environment.
- The environment is used during name resolution to determine trait conformance and associated type/value lookups.