Implement List.takeLast

This commit is contained in:
satotake 2021-11-09 12:26:17 +00:00 committed by GitHub
parent 35df58c18f
commit 772fc9c021
13 changed files with 142 additions and 1 deletions

View file

@ -978,6 +978,13 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
Box::new(list_type(flex(TVAR1))),
);
// takeLast : List elem, Nat -> List elem
add_top_level_function_type!(
Symbol::LIST_TAKE_LAST,
vec![list_type(flex(TVAR1)), nat_type()],
Box::new(list_type(flex(TVAR1))),
);
// drop : List elem, Nat -> List elem
add_top_level_function_type!(
Symbol::LIST_DROP,