mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Implement List.map4
This commit is contained in:
parent
b29a029a33
commit
f9ed060e49
16 changed files with 419 additions and 16 deletions
|
@ -930,6 +930,27 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
)
|
||||
};
|
||||
|
||||
{
|
||||
let_tvars! {a, b, c, d, e, cvar};
|
||||
|
||||
// map4 : List a, List b, List c, List d, (a, b, c, d -> e) -> List e
|
||||
add_top_level_function_type!(
|
||||
Symbol::LIST_MAP4,
|
||||
vec![
|
||||
list_type(flex(a)),
|
||||
list_type(flex(b)),
|
||||
list_type(flex(c)),
|
||||
list_type(flex(d)),
|
||||
closure(
|
||||
vec![flex(a), flex(b), flex(c), flex(d)],
|
||||
cvar,
|
||||
Box::new(flex(e))
|
||||
),
|
||||
],
|
||||
Box::new(list_type(flex(e))),
|
||||
)
|
||||
};
|
||||
|
||||
// append : List elem, elem -> List elem
|
||||
add_top_level_function_type!(
|
||||
Symbol::LIST_APPEND,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue