mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
basic List.keepIf set definition, but no implementation
This commit is contained in:
parent
22e92ae0d2
commit
30046d1ad4
9 changed files with 99 additions and 3 deletions
|
@ -783,6 +783,21 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
)
|
||||
});
|
||||
|
||||
// map : Attr * (List a)
|
||||
// , Attr Shared (a -> Attr * Bool)
|
||||
// -> Attr * (List b)
|
||||
add_type(Symbol::LIST_KEEP_IF, {
|
||||
let_tvars! { a, b, star1, star2, star3 };
|
||||
|
||||
unique_function(
|
||||
vec![
|
||||
list_type(star1, a),
|
||||
shared(SolvedType::Func(vec![flex(a)], Box::new(bool_type(star2)))),
|
||||
],
|
||||
list_type(star3, b),
|
||||
)
|
||||
});
|
||||
|
||||
// foldr : Attr (* | u) (List (Attr u a))
|
||||
// , Attr Shared (Attr u a -> b -> b)
|
||||
// , b
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue