Abstract

Transforming arrays of tuples into tuples of arrays and back again.

These are generally very cheap operations, as the internal compiler representation is always tuples of arrays.

Synopsis

val zip [n] 'a 'b : (as: [n]a) -> (bs: [n]b) -> *[n](a, b)
val zip2 [n] 'a 'b : (as: [n]a) -> (bs: [n]b) -> *[n](a, b)
val zip3 [n] 'a 'b 'c : (as: [n]a) -> (bs: [n]b) -> (cs: [n]c) -> *[n](a, b, c)
val zip4 [n] 'a 'b 'c 'd : (as: [n]a) -> (bs: [n]b) -> (cs: [n]c) -> (ds: [n]d) -> *[n](a, b, c, d)
val zip5 [n] 'a 'b 'c 'd 'e : (as: [n]a) -> (bs: [n]b) -> (cs: [n]c) -> (ds: [n]d) -> (es: [n]e) -> *[n](a, b, c, d, e)
val unzip [n] 'a 'b : (xs: [n](a, b)) -> ([n]a, [n]b)
val unzip2 [n] 'a 'b : (xs: [n](a, b)) -> ([n]a, [n]b)
val unzip3 [n] 'a 'b 'c : (xs: [n](a, b, c)) -> ([n]a, [n]b, [n]c)
val unzip4 [n] 'a 'b 'c 'd : (xs: [n](a, b, c, d)) -> ([n]a, [n]b, [n]c, [n]d)
val unzip5 [n] 'a 'b 'c 'd 'e : (xs: [n](a, b, c, d, e)) -> ([n]a, [n]b, [n]c, [n]d, [n]e)

Description

val zip [n] 'a 'b: (as: [n]a) -> (bs: [n]b) -> *[n](a, b)

Construct an array of pairs from two arrays.

val zip2 [n] 'a 'b: (as: [n]a) -> (bs: [n]b) -> *[n](a, b)

Construct an array of pairs from two arrays.

val zip3 [n] 'a 'b 'c: (as: [n]a) -> (bs: [n]b) -> (cs: [n]c) -> *[n](a, b, c)

As zip2, but with one more array.

val zip4 [n] 'a 'b 'c 'd: (as: [n]a) -> (bs: [n]b) -> (cs: [n]c) -> (ds: [n]d) -> *[n](a, b, c, d)

As zip3, but with one more array.

val zip5 [n] 'a 'b 'c 'd 'e: (as: [n]a) -> (bs: [n]b) -> (cs: [n]c) -> (ds: [n]d) -> (es: [n]e) -> *[n](a, b, c, d, e)

As zip4, but with one more array.

val unzip [n] 'a 'b: (xs: [n](a, b)) -> ([n]a, [n]b)

Turn an array of pairs into two arrays.

val unzip2 [n] 'a 'b: (xs: [n](a, b)) -> ([n]a, [n]b)

Turn an array of pairs into two arrays.

val unzip3 [n] 'a 'b 'c: (xs: [n](a, b, c)) -> ([n]a, [n]b, [n]c)

As unzip2, but with one more array.

val unzip4 [n] 'a 'b 'c 'd: (xs: [n](a, b, c, d)) -> ([n]a, [n]b, [n]c, [n]d)

As unzip3, but with one more array.

val unzip5 [n] 'a 'b 'c 'd 'e: (xs: [n](a, b, c, d, e)) -> ([n]a, [n]b, [n]c, [n]d, [n]e)

As unzip4, but with one more array.