Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
John Reppy edited this pageSep 2, 2015 ·1 revision
structure Array : ARRAY

We propose three new functions for theArray module.

This page is part of proposal2015-003.


Synopsis

val toList     : 'a array -> 'a listval fromVector : 'a vector -> 'a arrayval toVector   : 'a array -> 'a vector

Description

  • 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`.

Discussion

ThetoVector function is the same as the existingvector function, but itfollows thetoType/fromType naming convention.

Rationale

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.

Creative Commons License
This document is licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp