mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
List.walkRight definition in unique, std, builtins, etc. No implementation
This commit is contained in:
parent
e69595b794
commit
5d0ec57461
9 changed files with 82 additions and 24 deletions
|
@ -491,6 +491,19 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
),
|
||||
);
|
||||
|
||||
// walkRight : List elem, (elem -> accum -> accum), accum -> accum
|
||||
add_type(
|
||||
Symbol::LIST_WALK_RIGHT,
|
||||
SolvedType::Func(
|
||||
vec![
|
||||
list_type(flex(TVAR1)),
|
||||
SolvedType::Func(vec![flex(TVAR1), flex(TVAR2)], Box::new(flex(TVAR2))),
|
||||
flex(TVAR2),
|
||||
],
|
||||
Box::new(flex(TVAR2)),
|
||||
),
|
||||
);
|
||||
|
||||
// keepIf : List elem, (elem -> Bool) -> List elem
|
||||
add_type(
|
||||
Symbol::LIST_KEEP_IF,
|
||||
|
@ -515,19 +528,6 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
),
|
||||
);
|
||||
|
||||
// foldr : List a, (a -> b -> b), b -> b
|
||||
add_type(
|
||||
Symbol::LIST_FOLDR,
|
||||
SolvedType::Func(
|
||||
vec![
|
||||
list_type(flex(TVAR1)),
|
||||
SolvedType::Func(vec![flex(TVAR1), flex(TVAR2)], Box::new(flex(TVAR2))),
|
||||
flex(TVAR2),
|
||||
],
|
||||
Box::new(flex(TVAR2)),
|
||||
),
|
||||
);
|
||||
|
||||
// append : List elem, elem -> List elem
|
||||
add_type(
|
||||
Symbol::LIST_APPEND,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue