fp

Types

pub type ApplicativeInstance(a, b, fa, fb, fab) {
  ApplicativeInstance(
    functor_instance: fn() -> FunctorInstance(a, b, fa, fb),
    pure: fn(a) -> fa,
    ap: fn(fab, fa) -> fb,
  )
}

Constructors

  • ApplicativeInstance(
      functor_instance: fn() -> FunctorInstance(a, b, fa, fb),
      pure: fn(a) -> fa,
      ap: fn(fab, fa) -> fb,
    )
pub type FunctorInstance(a, b, fa, fb) {
  FunctorInstance(fmap: fn(fn(a) -> b, fa) -> fb)
}

Constructors

  • FunctorInstance(fmap: fn(fn(a) -> b, fa) -> fb)

Functions

pub fn ap(lhs: a, rhs: b, instance: fn() ->
    ApplicativeInstance(c, d, b, e, a)) -> e
pub fn ap_list(lhs: List(fn(a) -> b), rhs: List(a)) -> List(b)
pub fn ap_option(lhs: Option(fn(a) -> b), rhs: Option(a)) -> Option(
  b,
)
pub fn ap_result(lhs: Result(fn(a) -> b, c), rhs: Result(a, c)) -> Result(
  b,
  c,
)
pub fn fmap(lhs: fn(a) -> b, rhs: c, instance: fn() ->
    FunctorInstance(a, b, c, d)) -> d
pub fn fmap_function(lhs: fn(a) -> b, rhs: fn(c) -> a) -> fn(c) ->
  b
pub fn fmap_list(lhs: fn(a) -> b, rhs: List(a)) -> List(b)
pub fn fmap_option(lhs: fn(a) -> b, rhs: Option(a)) -> Option(b)
pub fn fmap_result(lhs: fn(a) -> b, rhs: Result(a, c)) -> Result(
  b,
  c,
)
pub fn function_functor_instance() -> FunctorInstance(
  a,
  b,
  fn(c) -> a,
  fn(c) -> b,
)
pub fn list_applicative_instance() -> ApplicativeInstance(
  a,
  b,
  List(a),
  List(b),
  List(fn(a) -> b),
)
pub fn list_functor_instance() -> FunctorInstance(
  a,
  b,
  List(a),
  List(b),
)
pub fn new_functor_instance(fmapper: fn(a, fn(b) -> c) -> d) -> FunctorInstance(
  b,
  c,
  a,
  d,
)
pub fn option_applicative_instance() -> ApplicativeInstance(
  a,
  b,
  Option(a),
  Option(b),
  Option(fn(a) -> b),
)
pub fn option_functor_instance() -> FunctorInstance(
  a,
  b,
  Option(a),
  Option(b),
)
pub fn pure(x: a, instance: fn() ->
    ApplicativeInstance(a, b, c, d, e)) -> c
pub fn pure_list(x: a) -> List(a)
pub fn pure_option(x: a) -> Option(a)
pub fn pure_result(x: a) -> Result(a, b)
pub fn result_applicative_instance() -> ApplicativeInstance(
  a,
  b,
  Result(a, c),
  Result(b, c),
  Result(fn(a) -> b, c),
)
pub fn result_functor_instance() -> FunctorInstance(
  a,
  b,
  Result(a, c),
  Result(b, c),
)
Search Document