adding List.sortAsc builtin

This commit is contained in:
Eric Newbury 2022-01-21 15:34:24 -05:00
parent c0ea664141
commit 05c01a81f5
4 changed files with 52 additions and 1 deletions

View file

@ -1302,6 +1302,13 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
Box::new(list_type(flex(TVAR1))),
);
// sortAsc : List (Num a) -> List (Num a)
add_top_level_function_type!(
Symbol::LIST_SORT_ASC,
vec![list_type(num_type(flex(TVAR1)))],
Box::new(list_type(num_type(flex(TVAR1))))
);
// find : List elem, (elem -> Bool) -> Result elem [ NotFound ]*
{
let not_found = SolvedType::TagUnion(