Implement basic List.drop that satisfies tests

Issues with uniqueness and copying which leaks memory obviously needs to be fixed.
This commit is contained in:
tarjei 2021-05-18 22:59:55 +02:00
parent b7b04344f3
commit f45d89270b
11 changed files with 130 additions and 3 deletions

View file

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