mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 06:14:46 +00:00
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:
parent
b7b04344f3
commit
f45d89270b
11 changed files with 130 additions and 3 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue