Implement List.any

This commit is contained in:
Kevin Sjöberg 2021-11-05 23:34:10 +01:00
parent 0e500ba33c
commit 44938a9e35
15 changed files with 137 additions and 6 deletions

View file

@ -1055,6 +1055,16 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
Box::new(bool_type())
);
// any: List elem, (elem -> Bool) -> Bool
add_top_level_function_type!(
Symbol::LIST_ANY,
vec![
list_type(flex(TVAR1)),
closure(vec![flex(TVAR1)], TVAR2, Box::new(bool_type())),
],
Box::new(bool_type()),
);
// sortWith : List a, (a, a -> Ordering) -> List a
add_top_level_function_type!(
Symbol::LIST_SORT_WITH,