Skip to content

Commit 93ad06a

Browse files
committed
Some cleanup in 'List.mapi'
1 parent 43e3080 commit 93ad06a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/List.trp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ let (* -- List Access -- *)
7272
(** Same as `List.map` but `f` is applied to the index of the element as first argument
7373
(counting from 0), and the element itself as second argument. Not tail-recursive. *)
7474
fun mapi f list =
75-
let fun mapj j [] = []
76-
| mapj j x::xs = (f (j,x)) :: (mapj (j+1) xs)
77-
in mapj 0 list
75+
let fun mapi_aux j [] = []
76+
| mapi_aux j x::xs = (f (j,x)) :: (mapi_aux (j+1) xs)
77+
in mapi_aux 0 list
7878
end
7979

8080
(* TODO: revMap *)

0 commit comments

Comments
 (0)