Array.Parallel Module
Provides parallel operations on arrays
Functions and values
Function or value |
Description
|
||||
Full Usage:
Array.Parallel.average array
Parameters:
^T array
-
The input array.
Returns: ^T
The average of the elements in the array.
Modifiers: inline Type parameters: ^T |
Returns the average of the elements in the array.
Example
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val average: array: 'T array -> 'T (requires member (+) and member DivideByInt)
Evaluates to 3.0
Example
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val average: array: 'T array -> 'T (requires member (+) and member DivideByInt)
Throws ArgumentException
|
||||
Full Usage:
Array.Parallel.averageBy projection array
Parameters:
'T -> ^U
-
The function to transform the array elements before averaging.
array : 'T array
-
The input array.
Returns: ^U
The computed average.
Modifiers: inline Type parameters: 'T, ^U |
Returns the average of the elements generated by applying the function to each element of the array.
Example
type Foo =
{ Bar: float }
Multiple items
val float: value: 'T -> float (requires member op_Explicit) -------------------- type float = System.Double -------------------- type float<'Measure> = float val input: Foo array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val averageBy: projection: ('T -> 'U) -> array: 'T array -> 'U (requires member (+) and member DivideByInt)
val foo: Foo
Foo.Bar: float
Evaluates to 3.0
Example
type Foo =
{ Bar: float }
Multiple items
val float: value: 'T -> float (requires member op_Explicit) -------------------- type float = System.Double -------------------- type float<'Measure> = float val input: Foo array
type 'T array = 'T array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val averageBy: projection: ('T -> 'U) -> array: 'T array -> 'U (requires member (+) and member DivideByInt)
val foo: Foo
Foo.Bar: float
Throws ArgumentException
|
||||
|
Apply the given function to each element of the array. Return
the array comprised of the results Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
val input: int option array
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val choose: chooser: ('T -> 'U option) -> array: 'T array -> 'U array
val id: x: 'T -> 'T
Evaluates to [| 1; 2 |]
Example
val input: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val choose: chooser: ('T -> 'U option) -> array: 'T array -> 'U array
val n: int
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
Evaluates to [| 2 |]
|
||||
|
For each element of the array, apply the given function. Concatenate all the results and return the combined array. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
type Foo =
{ Bar: int array }
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int type 'T array = 'T array
val input: Foo array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val collect: mapping: ('T -> 'U array) -> array: 'T array -> 'U array
val foo: Foo
Foo.Bar: int array
Evaluates to [| 1; 2; 3; 4 |]
Example
val input: int array array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val collect: mapping: ('T -> 'U array) -> array: 'T array -> 'U array
val id: x: 'T -> 'T
Evaluates to [| 1; 2; 3; 4 |]
|
||||
|
Tests if any element of the array satisfies the given predicate.
The predicate is applied to the elements of the input array in parallel. If any application
returns true then the overall result is true and testing of other elements in all threads is stopped at system's earliest convenience.
Otherwise,
Example
val input: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val exists: predicate: ('T -> bool) -> array: 'T array -> bool
val elm: int
Evaluates to true
Example
val input: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val exists: predicate: ('T -> bool) -> array: 'T array -> bool
val elm: int
Evaluates to false
|
||||
|
Returns a new collection containing only the elements of the collection
for which the given predicate returns
Example
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val filter: predicate: ('T -> bool) -> array: 'T array -> 'T array
val elm: int
Evaluates to [| 2; 4 |]
|
||||
|
Tests if all elements of the array satisfy the given predicate. The predicate is applied to the elements of the input collection in parallel. If any application returns false then the overall result is false and testing of other elements in all threads is stopped at system's earliest convenience. Otherwise, true is returned.
Example
val isEven: a: int -> bool
val a: int
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val forall: predicate: ('T -> bool) -> array: 'T array -> bool
|
||||
|
Applies a key-generating function to each element of an array in parallel and yields an array of unique keys. Each unique key contains an array of all elements that match to this key. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified. The order of the keys and values in the result is also not specified
Example
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val groupBy: projection: ('T -> 'Key) -> array: 'T array -> ('Key * 'T array) array (requires equality)
val n: int
Evaluates to [| (1, [| 1; 3; 5 |]); (0, [| 2; 4 |]) |]
|
||||
|
Create an array given the dimension and a generator function to compute the elements. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to indices is not specified.
Example
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val init: count: int -> initializer: (int -> 'T) -> 'T array
val v: int
Evaluates to [| 5; 6; 7; 8 |]
|
||||
|
Apply the given function to each element of the array. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
val inputs: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val iter: action: ('T -> unit) -> array: 'T array -> unit
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
Evaluates to unit and prints the following to the console in an unspecified order:
|
||||
|
Apply the given function to each element of the array. The integer passed to the function indicates the index of element. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
val inputs: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val iteri: action: (int -> 'T -> unit) -> array: 'T array -> unit
val i: int
val v: string
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
Evaluates to unit and prints the following to the console in an unspecified order:
|
||||
|
Build a new array whose elements are the results of applying the given function to each of the elements of the array. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
val inputs: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val map: mapping: ('T -> 'U) -> array: 'T array -> 'U array
val x: string
property System.String.Length: int with get
Evaluates to [| 1; 3; 2 |]
|
||||
|
Build a new array whose elements are the results of applying the given function to each of the elements of the array. The integer index passed to the function indicates the index of element being transformed. Performs the operation in parallel using Parallel.For. The order in which the given function is applied to elements of the input array is not specified.
Example
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val mapi: mapping: (int -> 'T -> 'U) -> array: 'T array -> 'U array
val i: int
val x: int
Evaluates to [| 10; 11; 12 |]
|
||||
Full Usage:
Array.Parallel.max array
Parameters:
'T array
-
The input array.
Returns: 'T
The maximum element.
Modifiers: inline Type parameters: 'T |
Returns the greatest of all elements of the array, compared via Operators.max. Throws ArgumentException for empty arrays.
Example
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val max: array: 'T array -> 'T (requires comparison)
Evaluates to 12
Example
val inputs: int array
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int type 'T array = 'T array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val max: array: 'T array -> 'T (requires comparison)
Throws System.ArgumentException .
|
||||
Full Usage:
Array.Parallel.maxBy projection array
Parameters:
'T -> 'U
-
The function to transform the elements into a type supporting comparison.
array : 'T array
-
The input array.
Returns: 'T
The maximum element.
Modifiers: inline Type parameters: 'T, 'U |
Returns the greatest of all elements of the array, compared via Operators.max on the function result. Throws ArgumentException for empty arrays.
Example
val inputs: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val maxBy: projection: ('T -> 'U) -> array: 'T array -> 'T (requires comparison)
val s: string
property System.String.Length: int with get
Evaluates to "cccc"
Example
val inputs: string array
Multiple items
val string: value: 'T -> string -------------------- type string = System.String type 'T array = 'T array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val maxBy: projection: ('T -> 'U) -> array: 'T array -> 'T (requires comparison)
val s: string
property System.String.Length: int with get
Throws System.ArgumentException .
|
||||
Full Usage:
Array.Parallel.min array
Parameters:
'T array
-
The input array.
Returns: 'T
The minimum element.
Modifiers: inline Type parameters: 'T |
Returns the smallest of all elements of the array, compared via Operators.min. Throws ArgumentException for empty arrays
Example
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val min: array: 'T array -> 'T (requires comparison)
Evaluates to 10
Example
val inputs: int array
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int type 'T array = 'T array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val min: array: 'T array -> 'T (requires comparison)
Throws System.ArgumentException .
|
||||
Full Usage:
Array.Parallel.minBy projection array
Parameters:
'T -> 'U
-
The function to transform the elements into a type supporting comparison.
array : 'T array
-
The input array.
Returns: 'T
The minimum element.
Modifiers: inline Type parameters: 'T, 'U |
Returns the lowest of all elements of the array, compared via Operators.min on the function result. Throws ArgumentException for empty arrays.
Example
val inputs: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val minBy: projection: ('T -> 'U) -> array: 'T array -> 'T (requires comparison)
val s: string
property System.String.Length: int with get
Evaluates to "b"
Example
val inputs: string array
Multiple items
val string: value: 'T -> string -------------------- type string = System.String type 'T array = 'T array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val minBy: projection: ('T -> 'U) -> array: 'T array -> 'T (requires comparison)
val s: string
property System.String.Length: int with get
Throws System.ArgumentException .
|
||||
|
Split the collection into two collections, containing the elements for which the given predicate returns "true" and "false" respectively Performs the operation in parallel using Parallel.For. The order in which the given function is applied to indices is not specified.
Example
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val partition: predicate: ('T -> bool) -> array: 'T array -> 'T array * 'T array
val x: int
Evaluates to ([|2; 4|], [|1; 3|]) .
|
||||
Full Usage:
Array.Parallel.reduce reduction array
Parameters:
'T -> 'T -> 'T
-
The function to reduce a pair of elements to a single element.
array : 'T array
-
The input array.
Returns: 'T
Result of the reductions.
Modifiers: inline Type parameters: 'T |
Applies a function to each element of the array in parallel, threading an accumulator argument through the computation for each thread involved in the computation. After processing entire input, results from all threads are reduced together. Raises ArgumentException if the array is empty. The order of processing is not guaranteed. For that reason, the 'reduce' function argument should be commutative. (That is, changing the order of execution must not affect the result) Also, compared to the non-parallel version of Array.reduce, the 'reduce' function may be invoked more times due to the resulting reduction from participating threads.
Example
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val reduce: reduction: ('T -> 'T -> 'T) -> array: 'T array -> 'T
val a: int
val b: int
Evaluates to 1 + 3 + 4 + 2 . However, the system could have decided to compute (1+3) and (4+2) first, and then put them together.
|
||||
Full Usage:
Array.Parallel.reduceBy projection reduction array
Parameters:
'T -> 'U
-
The function to project from elements of the input array
reduction : 'U -> 'U -> 'U
-
The function to reduce a pair of projected elements to a single element.
array : 'T array
-
The input array.
Returns: 'U
The final result of the reductions.
|
Applies a projection function to each element of the array in parallel, reducing elements in each thread with a dedicated 'reduction' function. After processing entire input, results from all threads are reduced together. Raises ArgumentException if the array is empty. The order of processing is not guaranteed. For that reason, the 'reduction' function argument should be commutative. (That is, changing the order of execution must not affect the result)
Example
val inputs: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val reduceBy: projection: ('T -> 'U) -> reduction: ('U -> 'U -> 'U) -> array: 'T array -> 'U
val x: string
Multiple items
Evaluates to val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int 1 + 3 + 4 + 2 . However, the system could have decided to compute (1+3) and (4+2) first, and then put them together.
|
||||
|
Sorts the elements of an array in parallel, returning a new array. Elements are compared using Operators.compare. This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.Sort.
Example
val input: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val sort: array: 'T array -> 'T array (requires comparison)
Evaluates to [| 1; 1 3; 4; 6; 8 |] .
|
||||
|
Sorts the elements of an array in parallel, using the given projection for the keys and returning a new array. Elements are compared using Operators.compare. This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.Sort.
Example
val input: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val sortBy: projection: ('T -> 'Key) -> array: 'T array -> 'T array (requires comparison)
val s: string
property System.String.Length: int with get
Evaluates to [|"a"; "dd"; "bbb"; "cccc"|] .
|
||||
|
Sorts the elements of an array in parallel, in descending order, using the given projection for the keys and returning a new array. Elements are compared using Operators.compare. This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.Sort.
Example
val input: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val sortByDescending: projection: ('T -> 'Key) -> array: 'T array -> 'T array (requires comparison)
val s: string
property System.String.Length: int with get
Evaluates to [|"cccc"; "bbb"; "dd"; "a"|] .
|
||||
|
Sorts the elements of an array in parallel, in descending order, returning a new array. Elements are compared using Operators.compare. This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.Sort.
Example
val input: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val sortDescending: array: 'T array -> 'T array (requires comparison)
Evaluates to [| 8; 6; 4; 3; 1; 1 |] .
|
||||
|
Sorts the elements of an array by mutating the array in-place in parallel, using the given comparison function. Elements are compared using Operators.compare.
Example
Multiple items
val array: int array -------------------- type 'T array = 'T array module Array
from Microsoft.FSharp.Collections
val sortInPlace: array: 'T array -> unit (requires comparison)
After evaluation array contains [| 1; 1; 3; 4; 6; 8 |] .
|
||||
Full Usage:
Array.Parallel.sortInPlaceBy projection array
Parameters:
'T -> 'Key
-
The function to transform array elements into the type that is compared.
array : 'T array
-
The input array.
|
Sorts the elements of an array by mutating the array in-place in parallel, using the given projection for the keys. Elements are compared using Operators.compare. This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.Sort.
Example
Multiple items
val array: string array -------------------- type 'T array = 'T array module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val sortInPlaceBy: projection: ('T -> 'Key) -> array: 'T array -> unit (requires comparison)
val s: string
property System.String.Length: int with get
After evaluation array contains [|"a"; "dd"; "bbb"; "cccc"|] .
|
||||
|
Sorts the elements of an array by mutating the array in-place in parallel, using the given comparison function as the order.
ExampleThe following sorts entries using a comparison function that compares string lengths then index numbers:
val compareEntries: n1: int * s1: string -> n2: int * s2: string -> int
val n1: int
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int val s1: string
Multiple items
val string: value: 'T -> string -------------------- type string = System.String val n2: int
val s2: string
val c: int
val compare: e1: 'T -> e2: 'T -> int (requires comparison)
property System.String.Length: int with get
Multiple items
val array: (int * string) array -------------------- type 'T array = 'T array module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val sortInPlaceWith: comparer: ('T -> 'T -> int) -> array: 'T array -> unit
After evaluation array contains [|(0, "aa"); (2, "cc"); (3, "dd"); (1, "bbb")|] .
|
||||
|
Sorts the elements of an array in parallel, using the given comparison function as the order, returning a new array. This is not a stable sort, i.e. the original order of equal elements is not necessarily preserved. For a stable sort, consider using Seq.Sort.
ExampleSort an array of pairs using a comparison function that compares string lengths then index numbers:
val compareEntries: n1: int * s1: string -> n2: int * s2: string -> int
val n1: int
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int val s1: string
Multiple items
val string: value: 'T -> string -------------------- type string = System.String val n2: int
val s2: string
val c: int
val compare: e1: 'T -> e2: 'T -> int (requires comparison)
property System.String.Length: int with get
val input: (int * string) array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val sortWith: comparer: ('T -> 'T -> int) -> array: 'T array -> 'T array
Evaluates to [|(0, "aa"); (2, "cc"); (3, "dd"); (1, "bbb")|] .
|
||||
Full Usage:
Array.Parallel.sum array
Parameters:
^T array
-
The input array.
Returns: ^T
The resulting sum.
Modifiers: inline Type parameters: ^T |
Returns the sum of the elements in the array.
Example
val input: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val sum: array: 'T array -> 'T (requires member (+) and member Zero)
Evaluates to 11 .
|
||||
Full Usage:
Array.Parallel.sumBy projection array
Parameters:
'T -> ^U
-
The function to transform the array elements into the type to be summed.
array : 'T array
-
The input array.
Returns: ^U
The resulting sum.
Modifiers: inline Type parameters: 'T, ^U |
Returns the sum of the results generated by applying the function to each element of the array.
Example
val input: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val sumBy: projection: ('T -> 'U) -> array: 'T array -> 'U (requires member (+) and member Zero)
val s: string
property System.String.Length: int with get
Evaluates to 7 .
|
||||
|
Returns the first element for which the given function returns
ExampleTry to find the first even number:
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val tryFind: predicate: ('T -> bool) -> array: 'T array -> 'T option
val elm: int
Evaluates to Some 2 .
ExampleTry to find the first even number:
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val tryFind: predicate: ('T -> bool) -> array: 'T array -> 'T option
val elm: int
Evaluates to None
|
||||
|
Returns the index of the first element in the array
that satisfies the given predicate.
Returns
ExampleTry to find the index of the first even number:
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val tryFindIndex: predicate: ('T -> bool) -> array: 'T array -> int option
val elm: int
Evaluates to Some 1
ExampleTry to find the index of the first even number:
val inputs: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val tryFindIndex: predicate: ('T -> bool) -> array: 'T array -> int option
val elm: int
Evaluates to None
|
||||
|
Applies the given function to successive elements, returning the first
result where the function returns
Example
val input: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val tryPick: chooser: ('T -> 'U option) -> array: 'T array -> 'U option
val n: int
union case Option.Some: Value: 'T -> Option<'T>
Multiple items
val string: value: 'T -> string -------------------- type string = System.String union case Option.None: Option<'T>
Evaluates to Some 2 .
Example
val input: int array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val tryPick: chooser: ('T -> 'U option) -> array: 'T array -> 'U option
val n: int
union case Option.Some: Value: 'T -> Option<'T>
Multiple items
val string: value: 'T -> string -------------------- type string = System.String union case Option.None: Option<'T>
Evaluates to None .
|
||||
|
Combines the two arrays into an array of pairs. The two arrays must have equal lengths, otherwise an
Example
val numbers: int array
val names: string array
module Array
from Microsoft.FSharp.Collections
module Parallel
from Microsoft.FSharp.Collections.ArrayModule
val zip: array1: 'T1 array -> array2: 'T2 array -> ('T1 * 'T2) array
Evaluates to [| (1, "one"); (2, "two") |] .
|