Zafu/Abstract/Applicative

Zafu/Abstract/Applicative

source code:

public dependencies: Zafu/Abstract/Eq

Index

Types

Applicative[f]

type Applicative[f: * -> *]

Values

ap

references: Applicative

def ap[a: * -> *, b, c](inst: Applicative[a], ff: a[b -> c], fa: a[b]) -> a[c]

applicative_from_pure_map_map2

Minimal constructor. product_left/product_right/void are derived.

references: Applicative

def applicative_from_pure_map_map2[a: * -> *](
    pure_fn: forall b: *. b -> a[b],
    map_fn: forall b: *, c: *. (a[b], b -> c) -> a[c],
    map2_fn: forall b: *, c: *, d: *. (a[b], a[c], (b, c) -> d) -> a[d]
) -> Applicative[a]

applicative_specialized

Constructor for fully specialized implementations.

references: Applicative, Unit

def applicative_specialized[a: * -> *](
    pure_fn: forall b: *. b -> a[b],
    map_fn: forall b: *, c: *. (a[b], b -> c) -> a[c],
    map2_fn: forall b: *, c: *, d: *. (a[b], a[c], (b, c) -> d) -> a[d],
    product_left_fn: forall b: *, c: *. (a[b], a[c]) -> a[b],
    product_right_fn: forall b: *, c: *. (a[b], a[c]) -> a[c],
    void_fn: forall b: *. a[b] -> a[()]
) -> Applicative[a]

laws_Applicative

references: Applicative, Test, Zafu/Abstract/Eq::Eq

def laws_Applicative[a: * -> *, b, c, d](
    inst: Applicative[a],
    eq_fa: Zafu/Abstract/Eq::Eq[a[b]],
    eq_fb: Zafu/Abstract/Eq::Eq[a[c]],
    eq_fc: Zafu/Abstract/Eq::Eq[a[d]],
    fa: a[b],
    ff_ab: a[b -> c],
    ff_bc: a[c -> d],
    fn_ab: b -> c,
    x: b
) -> Test

map

references: Applicative

def map[a: * -> *, b, c](fa: a[b], inst: Applicative[a], fn: b -> c) -> a[c]

map2

references: Applicative

def map2[a: * -> *, b, c, d](inst: Applicative[a], left: a[b], right: a[c], fn: (b, c) -> d) -> a[d]

product2

references: Applicative, Tuple2

def product2[a: * -> *, b, c](inst: Applicative[a], fa: a[b], fb: a[c]) -> a[(b, c)]

product3

references: Applicative, Tuple3

def product3[a: * -> *, b, c, d](inst: Applicative[a], fa: a[b], fb: a[c], fc: a[d]) -> a[(b, c, d)]

product4

references: Applicative, Tuple4

def product4[a: * -> *,
    b,
    c,
    d,
    e](inst: Applicative[a], fa: a[b], fb: a[c], fc: a[d], fd: a[e]) -> a[(b, c, d, e)]

product5

references: Applicative, Tuple5

def product5[a: * -> *,
    b,
    c,
    d,
    e,
    f](inst: Applicative[a], fa: a[b], fb: a[c], fc: a[d], fd: a[e], fe: a[f]) -> a[(b, c, d, e, f)]

product_left

references: Applicative

def product_left[a: * -> *, b, c](inst: Applicative[a], left: a[b], right: a[c]) -> a[b]

product_right

references: Applicative

def product_right[a: * -> *, b, c](inst: Applicative[a], left: a[b], right: a[c]) -> a[c]

pure

references: Applicative

def pure[a: * -> *, b](inst: Applicative[a], value: b) -> a[b]

void

references: Applicative, Unit

def void[a: * -> *, b](fa: a[b], inst: Applicative[a]) -> a[()]