mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00
Explain pushing/popping types on region labelling stack
This commit is contained in:
parent
460b822caa
commit
759134885b
1 changed files with 10 additions and 2 deletions
|
@ -2769,8 +2769,16 @@ fn instantiate_lambda_sets_as_unspecialized(
|
|||
able_var: Variable,
|
||||
ability_member: Symbol,
|
||||
) {
|
||||
// We want to pop and assign lambda sets pre-order for readability, so types
|
||||
// should be pushed onto the stack in post-order
|
||||
// REGION-ORDERING: done in pre-order via the following pseudo code:
|
||||
//
|
||||
// Type_function = \region ->
|
||||
// let left_type, new_region = Type (region + 1)
|
||||
// let right_type, new_region = Type (new_region)
|
||||
// let func_type = left_type -[Lambda region]-> right_type
|
||||
// (func_type, new_region)
|
||||
//
|
||||
// Since we want to pop types in pre-order, they should be pushed onto the
|
||||
// stack in post-order
|
||||
let mut stack = vec![typ];
|
||||
let mut region = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue