mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
adds List.last
This commit is contained in:
parent
b5dcde267a
commit
51a302957f
6 changed files with 198 additions and 6 deletions
|
@ -465,6 +465,15 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
|||
|
||||
add_type(
|
||||
Symbol::LIST_FIRST,
|
||||
top_level_function(
|
||||
vec![list_type(flex(TVAR1))],
|
||||
Box::new(result_type(flex(TVAR1), list_was_empty.clone())),
|
||||
),
|
||||
);
|
||||
|
||||
// last : List elem -> Result elem [ ListWasEmpty ]*
|
||||
add_type(
|
||||
Symbol::LIST_LAST,
|
||||
top_level_function(
|
||||
vec![list_type(flex(TVAR1))],
|
||||
Box::new(result_type(flex(TVAR1), list_was_empty)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue