gxyz/gxyz_tuple

Functions

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 at2_0(tuple: #(a, b)) -> a

returns the 1st element of a tuple of length 2

pub fn at2_1(tuple: #(a, b)) -> b

returns the 2nd element of a tuple of length 2

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

returns the 1st element of a tuple of length 3

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

returns the 2nd element of a tuple of length 3

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

returns the 3rd element of a tuple of length 3

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

returns the 1st element of a tuple of length 4

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

returns the 2nd element of a tuple of length 4

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

returns the 3rd element of a tuple of length 4

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

returns the 4th element of a tuple of length 4

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

returns the 1st element of a tuple of length 5

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

returns the 2nd element of a tuple of length 5

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

returns the 3rd element of a tuple of length 5

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

returns the 4th element of a tuple of length 5

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

returns the 5th element of a tuple of length 5

pub fn at_dynamic(
  tuple: a,
  index: Int,
  fun: fn(Dynamic) -> Result(b, List(DecodeError)),
) -> Result(b, List(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) -> c) -> #(c, b)

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

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

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

pub fn map3_0(tuple: #(a, b, c), fun: fn(a) -> d) -> #(d, 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) -> d) -> #(a, d, 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) -> d) -> #(a, b, d)

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) -> e,
) -> #(e, 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) -> e,
) -> #(a, e, 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) -> e,
) -> #(a, b, e, 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) -> e,
) -> #(a, b, c, e)

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) -> f,
) -> #(f, 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) -> f,
) -> #(a, f, 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) -> f,
) -> #(a, b, f, 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) -> f,
) -> #(a, b, c, f, 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) -> f,
) -> #(a, b, c, d, f)

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

Search Document