mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
Reorder args for List.walk and friends
This commit is contained in:
parent
b4e4ae2ff3
commit
1abebb7713
2 changed files with 8 additions and 8 deletions
|
|
@ -746,24 +746,24 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
Box::new(num_type(flex(TVAR1))),
|
||||
);
|
||||
|
||||
// walk : List elem, (elem -> accum -> accum), accum -> accum
|
||||
// walk : List elem, state, (state, elem -> state) -> state
|
||||
add_top_level_function_type!(
|
||||
Symbol::LIST_WALK,
|
||||
vec![
|
||||
list_type(flex(TVAR1)),
|
||||
closure(vec![flex(TVAR1), flex(TVAR2)], TVAR3, Box::new(flex(TVAR2))),
|
||||
flex(TVAR2),
|
||||
closure(vec![flex(TVAR2), flex(TVAR1)], TVAR3, Box::new(flex(TVAR2))),
|
||||
],
|
||||
Box::new(flex(TVAR2)),
|
||||
);
|
||||
|
||||
// walkBackwards : List elem, (elem -> accum -> accum), accum -> accum
|
||||
// walkBackwards : List elem, state, (state, elem -> state) -> state
|
||||
add_top_level_function_type!(
|
||||
Symbol::LIST_WALK_BACKWARDS,
|
||||
vec![
|
||||
list_type(flex(TVAR1)),
|
||||
closure(vec![flex(TVAR1), flex(TVAR2)], TVAR3, Box::new(flex(TVAR2))),
|
||||
flex(TVAR2),
|
||||
closure(vec![flex(TVAR2), flex(TVAR1)], TVAR3, Box::new(flex(TVAR2))),
|
||||
],
|
||||
Box::new(flex(TVAR2)),
|
||||
);
|
||||
|
|
@ -779,17 +779,17 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
)
|
||||
}
|
||||
|
||||
// walkUntil : List elem, (elem -> accum -> [ Continue accum, Stop accum ]), accum -> accum
|
||||
// walkUntil : List elem, state, (state, elem -> [ Continue state, Stop state ]) -> state
|
||||
add_top_level_function_type!(
|
||||
Symbol::LIST_WALK_UNTIL,
|
||||
vec![
|
||||
list_type(flex(TVAR1)),
|
||||
flex(TVAR2),
|
||||
closure(
|
||||
vec![flex(TVAR1), flex(TVAR2)],
|
||||
TVAR3,
|
||||
Box::new(until_type(flex(TVAR2))),
|
||||
),
|
||||
flex(TVAR2),
|
||||
],
|
||||
Box::new(flex(TVAR2)),
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue