- Notifications
You must be signed in to change notification settings - Fork5
2015 003l ArraySlice
John Reppy edited this pageJul 9, 2023 ·1 revision
structure ArraySlice : ARRAY_SLICEWe propose two new functions for theArraySlice module.
This page is part of proposal2015-003.
val toList : 'a slice -> 'a listval toVector : 'a slice -> 'a vector
toList arr
returns the list of the elements of the array `arr`.
toVector vec
returns a vector of the elements of the array `arr`.
ThetoVector function is the same as the existingvector function, but itfollows thetoType/fromType naming convention.
ThetoList operation complements the existingfromList and can be implemented moreefficiently than by usingList.tabulate.Adding thefromVector andtoVector functions help reduce the friction of convertingbetween different sequence types.
