basic List.keepIf set definition, but no implementation

This commit is contained in:
Chad Stearns 2020-08-29 15:47:11 -04:00
parent 22e92ae0d2
commit 30046d1ad4
9 changed files with 99 additions and 3 deletions

View file

@ -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