- Notifications
You must be signed in to change notification settings - Fork5
2015 003g Array
John Reppy edited this pageSep 2, 2015 ·1 revision
structure Array : ARRAYWe propose three new functions for theArray module.
This page is part of proposal2015-003.
val toList : 'a array -> 'a listval fromVector : 'a vector -> 'a arrayval toVector : 'a array -> 'a vector
toList arr
returns the list of the elements of the array `arr`.
fromVector vec
returns a new array that is initialized to the content of the vector `vec`.
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.
