Skip to main content
Version: 1.6.0

tuple2

Binary tuples

let curry: <a, b, c>(_: (_: [a, b]) => c) => (_: a) => (_: b) => c

The call curry(f,x,y) has the same value as f(x,y).

let uncurry: <a, b, c>(_: (_: a) => (_: b) => c) => (_: [a, b]) => c

The call uncurry(f,[x,y]) has the same value as f(x)(y).

let get1: <a, b>(_: [a, b]) => a

Projecting the first component of a pair

let get2: <a, b>(_: [a, b]) => b

Projecting the second component of a pair.

let swap: <a, b>(_: [a, b]) => [b, a]

Swap the components of a pair.