functional module

Maylang standard-library module.

import "functional" as functional;

Module note — Memoization keys use str(arg); distinct arguments with identical display strings share a cached result.

Functions

identity

may
fun identity<T>(x: T) -> T

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

constantly

may
fun constantly<T>(value: T) -> (Any) -> T

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

compose

may
fun compose<A, B, C>(f: (B) -> C, g: (A) -> B) -> (A) -> C

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

compose3

may
fun compose3<A, B, C, D>(f: (C) -> D, g: (B) -> C, h: (A) -> B) -> (A) -> D

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

flip

may
fun flip<A, B, C>(f: (A, B) -> C) -> (B, A) -> C

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

curry

may
fun curry<A, B, C>(f: (A, B) -> C) -> (A) -> (B) -> C

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

uncurry

may
fun uncurry<A, B, C>(f: (A) -> (B) -> C) -> (A, B) -> C

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

apply_n

may
fun apply_n<T>(f: (T) -> T, x: T, n: Int) -> T

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

pipeline

may
fun pipeline<T>(x: T, fs: List<(T) -> T>) -> T

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

compose_all

may
fun compose_all<T>(fs: List<(T) -> T>) -> (T) -> T

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

memoize

may
fun memoize<T, U>(f: (T) -> U) -> (T) -> U

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source

partial_first

may
fun partial_first<A, B, C>(f: (A, B) -> C, first: A) -> (B) -> C

No description yet. Read the declaration source for the exact contract.

supported · full runtime · source