Merge pull request #3399 from rtfeldman/pure-roc-map-with-index

Pure Roc `List.mapWithIndex`
This commit is contained in:
Folkert de Vries 2022-07-06 00:25:46 +02:00 committed by GitHub
commit 93dbda9ac5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 231 additions and 367 deletions

View file

@ -41,7 +41,6 @@ pub enum LowLevel {
ListMap2,
ListMap3,
ListMap4,
ListMapWithIndex,
ListSortWith,
ListSublist,
ListDropAt,
@ -126,7 +125,7 @@ pub enum LowLevel {
macro_rules! higher_order {
() => {
ListMap | ListMap2 | ListMap3 | ListMap4 | ListMapWithIndex | ListSortWith | DictWalk
ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith | DictWalk
};
}
@ -147,7 +146,6 @@ impl LowLevel {
ListMap2 => 2,
ListMap3 => 3,
ListMap4 => 4,
ListMapWithIndex => 1,
ListSortWith => 1,
DictWalk => 2,
_ => unreachable!(),
@ -216,7 +214,6 @@ impl LowLevelWrapperType {
Symbol::LIST_MAP2 => WrapperIsRequired,
Symbol::LIST_MAP3 => WrapperIsRequired,
Symbol::LIST_MAP4 => WrapperIsRequired,
Symbol::LIST_MAP_WITH_INDEX => WrapperIsRequired,
Symbol::LIST_SORT_WITH => WrapperIsRequired,
Symbol::LIST_SUBLIST => WrapperIsRequired,
Symbol::LIST_DROP_AT => CanBeReplacedBy(ListDropAt),