mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
add builtin List.min
This commit is contained in:
parent
d7083d5daf
commit
c721a1cc1f
4 changed files with 159 additions and 1 deletions
|
@ -722,7 +722,7 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
add_top_level_function_type!(
|
||||
Symbol::LIST_LAST,
|
||||
vec![list_type(flex(TVAR1))],
|
||||
Box::new(result_type(flex(TVAR1), list_was_empty)),
|
||||
Box::new(result_type(flex(TVAR1), list_was_empty.clone())),
|
||||
);
|
||||
|
||||
// set : List elem, Nat, elem -> List elem
|
||||
|
@ -746,6 +746,13 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
Box::new(bool_type()),
|
||||
);
|
||||
|
||||
// min : List (Num a) -> Result (Num a) [ ListWasEmpty ]*
|
||||
add_top_level_function_type!(
|
||||
Symbol::LIST_MIN,
|
||||
vec![list_type(num_type(flex(TVAR1)))],
|
||||
Box::new(result_type(num_type(flex(TVAR1)), list_was_empty)),
|
||||
);
|
||||
|
||||
// sum : List (Num a) -> Num a
|
||||
add_top_level_function_type!(
|
||||
Symbol::LIST_SUM,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue