gextra/function

Functions

pub fn hole(func: fn(a, b) -> c, a: a) -> fn(b) -> c
pub fn hole2(func: fn(a, b, c) -> d, a: a) -> fn(b, c) -> d
pub fn hole3(func: fn(a, b, c, d) -> e, a: a) -> fn(b, c, d) -> e
pub fn hole4(
  func: fn(a, b, c, d, e) -> f,
  a: a,
) -> fn(b, c, d, e) -> f
pub fn hole5(
  func: fn(a, b, c, d, e, f) -> g,
  a: a,
) -> fn(b, c, d, e, f) -> g
pub fn hole6(
  func: fn(a, b, c, d, e, f, g) -> h,
  a: a,
) -> fn(b, c, d, e, f, g) -> h
pub fn hole7(
  func: fn(a, b, c, d, e, f, g, h) -> i,
  a: a,
) -> fn(b, c, d, e, f, g, h) -> i
pub fn hole8(
  func: fn(a, b, c, d, e, f, g, h, i) -> j,
  a: a,
) -> fn(b, c, d, e, f, g, h, i) -> j
pub fn pipe1(func: fn(a, b) -> c, a: a) -> fn(b) -> c

Allows piping into a two argument function in a use statement.

Example

fn main() {
  use n <- 32
    |> int.div(2)
    |> pipe(result.map)
  let assert 16 = n
}
pub fn pipe2(func: fn(a, b, c) -> d, a: a, b: b) -> fn(c) -> d

Allows piping into a three argument function in a use statement.

pub fn pipe3(
  func: fn(a, b, c, d) -> e,
  a: a,
  b: b,
  c: c,
) -> fn(d) -> e

Allows piping into a four argument function in a use statement.

pub fn pipe4(
  func: fn(a, b, c, d, e) -> f,
  a: a,
  b: b,
  c: c,
  d: d,
) -> fn(e) -> f

Allows piping into a five argument function in a use statement.

pub fn pipe5(
  func: fn(a, b, c, d, e, f) -> g,
  a: a,
  b: b,
  c: c,
  d: d,
  e: e,
) -> fn(f) -> g

Allows piping into a six argument function in a use statement.

pub fn pipe6(
  func: fn(a, b, c, d, e, f, g) -> h,
  a: a,
  b: b,
  c: c,
  d: d,
  e: e,
  f: f,
) -> fn(g) -> h

Allows piping into a seven argument function in a use statement.

pub fn pipe7(
  func: fn(a, b, c, d, e, f, g, h) -> i,
  a: a,
  b: b,
  c: c,
  d: d,
  e: e,
  f: f,
  g: g,
) -> fn(h) -> i

Allows piping into an eight argument function in a use statement.

pub fn pipe8(
  func: fn(a, b, c, d, e, f, g, h, i) -> j,
  a: a,
  b: b,
  c: c,
  d: d,
  e: e,
  f: f,
  g: g,
  h: h,
) -> fn(i) -> j

Allows piping into a nine argument function in a use statement.

Search Document