Implement List.takeFirst

This commit is contained in:
satotake 2021-11-08 14:10:53 +00:00 committed by GitHub
parent 978f9e0bc6
commit 878400f95f
13 changed files with 145 additions and 1 deletions

View file

@ -971,6 +971,13 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
Box::new(list_type(flex(TVAR1))),
);
// takeFirst : List elem, Nat -> List elem
add_top_level_function_type!(
Symbol::LIST_TAKE_FIRST,
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,