gxyz/tuple

Values

pub fn apply_from2(tuple: #(a, b), fun: fn(a, b) -> c) -> c

use the values of a tuple of length 2 as the arguments to the supplied function

pub fn apply_from3(tuple: #(a, b, c), fun: fn(a, b, c) -> d) -> d

use the values of a tuple of length 3 as the arguments to the supplied function

pub fn apply_from4(
  tuple: #(a, b, c, d),
  fun: fn(a, b, c, d) -> e,
) -> e

use the values of a tuple of length 4 as the arguments to the supplied function

pub fn apply_from5(
  tuple: #(a, b, c, d, e),
  fun: fn(a, b, c, d, e) -> f,
) -> f

use the values of a tuple of length 5 as the arguments to the supplied function

pub fn at_dynamic(
  tuple: a,
  index: Int,
  decoder: decode.Decoder(b),
) -> Result(b, List(decode.DecodeError))

returns the value at index from the a tuple, using a dynamic.Decode function

pub fn map2_0(
  tuple: #(a, b),
  fun: fn(a) -> mapped,
) -> #(mapped, b)

applies the function to the 1st element of a tuple of length 2

pub fn map2_1(
  tuple: #(a, b),
  fun: fn(b) -> mapped,
) -> #(a, mapped)

applies the function to the 2nd element of a tuple of length 2

pub fn map3_0(
  tuple: #(a, b, c),
  fun: fn(a) -> mapped,
) -> #(mapped, b, c)

applies the function to the 1st element of a tuple of length 3

pub fn map3_1(
  tuple: #(a, b, c),
  fun: fn(b) -> mapped,
) -> #(a, mapped, c)

applies the function to the 2nd element of a tuple of length 3

pub fn map3_2(
  tuple: #(a, b, c),
  fun: fn(c) -> mapped,
) -> #(a, b, mapped)

applies the function to the 3rd element of a tuple of length 3

pub fn map4_0(
  tuple: #(a, b, c, d),
  fun: fn(a) -> mapped,
) -> #(mapped, b, c, d)

applies the function to the 1st element of a tuple of length 4

pub fn map4_1(
  tuple: #(a, b, c, d),
  fun: fn(b) -> mapped,
) -> #(a, mapped, c, d)

applies the function to the 2nd element of a tuple of length 4

pub fn map4_2(
  tuple: #(a, b, c, d),
  fun: fn(c) -> mapped,
) -> #(a, b, mapped, d)

applies the function to the 3rd element of a tuple of length 4

pub fn map4_3(
  tuple: #(a, b, c, d),
  fun: fn(d) -> mapped,
) -> #(a, b, c, mapped)

applies the function to the 4th element of a tuple of length 4

pub fn map5_0(
  tuple: #(a, b, c, d, e),
  fun: fn(a) -> mapped,
) -> #(mapped, b, c, d, e)

applies the function to the 1st element of a tuple of length 5

pub fn map5_1(
  tuple: #(a, b, c, d, e),
  fun: fn(b) -> mapped,
) -> #(a, mapped, c, d, e)

applies the function to the 2nd element of a tuple of length 5

pub fn map5_2(
  tuple: #(a, b, c, d, e),
  fun: fn(c) -> mapped,
) -> #(a, b, mapped, d, e)

applies the function to the 3rd element of a tuple of length 5

pub fn map5_3(
  tuple: #(a, b, c, d, e),
  fun: fn(d) -> mapped,
) -> #(a, b, c, mapped, e)

applies the function to the 4th element of a tuple of length 5

pub fn map5_4(
  tuple: #(a, b, c, d, e),
  fun: fn(e) -> mapped,
) -> #(a, b, c, d, mapped)

applies the function to the 5th element of a tuple of length 5

Search Document