package rea

  1. Overview
  2. Docs

Data type traversal use cases.

val to_map : (('b -> (Identity.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) monad' as 'D) er) -> ('b -> 'a) -> 't -> 's

Convert traversal to map.

val to_set : (('b -> (Identity.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) monad' as 'D) er) -> 'a -> 't -> 's

Convert traversal to set.

val to_map_constant : (('b -> ('c Constant.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, 'D) er) -> 'D -> ('b -> 'c) -> 't -> 'c

Convert traversal to map with constant.

val to_get : (('c -> ('c Constant.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) functr' as 'D) er) -> 't -> 'c

Convert traversal to get.

val to_get_opt : (('c -> ('c option Constant.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) applicative' as 'D) er) -> 't -> 'c option

Convert traversal to get_opt.

val to_exists : (('b -> (bool Constant.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) applicative' as 'D) er) -> ('b -> bool) -> 't -> bool

Convert traversal to exists.

val to_find_map : (('b -> ('c option Constant.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) applicative' as 'D) er) -> ('b -> 'c option) -> 't -> 'c option

Convert traversal to find_map.

val to_map_reduce : (('b -> ('c Constant.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) applicative' as 'D) er) -> 'c lazy_op'2 -> 'c -> ('b -> 'c) -> 't -> 'c

Convert traversal to map_reduce.

val to_iter_er : (('b -> ('c Constant.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) applicative' as 'D) er) -> ('b -> ('Ru, 'eu, unit, ['Ru, 'Du] monad' as 'Du) er as 'c) -> 't -> 'c

Convert traversal to iter_er.

val to_exists_er : (('b -> ('c Constant.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) applicative' as 'D) er) -> ('b -> ('Ru, 'eu, bool, ['Ru, 'Du] monad' as 'Du) er as 'c) -> 't -> 'c

Convert traversal to exists_er.

val to_find_map_er : (('b -> ('c Constant.r as 'R, 'e, 'a, 'D) er) -> 't -> ('R, 'e, 's, ('R, 'D) applicative' as 'D) er) -> ('b -> ('Ru, 'eu, 'x option, ['Ru, 'Du] monad' as 'Du) er as 'c) -> 't -> 'c

Convert traversal to find_map_er.

OCaml

Innovation. Community. Security.