add first version of List.dropAt

* adds an implementation with no uniqueness/mutability
This commit is contained in:
Dan Knutson 2021-10-02 20:03:07 -05:00
parent ff9866420b
commit 3baff93a97
11 changed files with 145 additions and 13 deletions

View file

@ -920,6 +920,13 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
Box::new(list_type(flex(TVAR1))),
);
// dropAt : List elem, Nat -> List elem
add_top_level_function_type!(
Symbol::LIST_DROP_AT,
vec![list_type(flex(TVAR1)), nat_type()],
Box::new(list_type(flex(TVAR1))),
);
// swap : List elem, Nat, Nat -> List elem
add_top_level_function_type!(
Symbol::LIST_SWAP,