let
mapi_as_list f a =
Array
.to_list (
Array
.mapi f (
Array
.sub a.data 0 a.length))