traverse

Traversable data structures with applicative functors
README

This library provides:

  • a module signature Traverse.Applicative.S for applicative functors
    [McBride and Patterson, 2008],

  • two functions Traverse.list and Traverse.seq to traverse lists
    and sequences by a given applicative functor and with a given arity,

  • many instances of applicative functors:
    Traverse.Applicative.{iter, map, reduce, env, fold, pair, forall, exists, option, result, list}.

The purpose of this library is to provide a common dictionary of
"visitors", which is orthogonal to the visited data structure. For
instance, Traverse.list Traverse.Applicative.iter (S O) is
equivalent to List.iter, Traverse.list Traverse.Applicative.map (S (S O)) is equivalent to List.map2, etc. Moreover, one can get a
visitor which combine, for instance, both List.map and
List.fold_left by invoking Traverse.list Traverse.Applicative.(pair map fold). To get the same visitors for a sequence ('a Seq.t), one
just have to replace Traverse.list by Traverse.seq, and it is easy
to define a traversal for any algebraic data structures.

Install
Published
11 May 2020
Sources
v0.2.0.tar.gz
sha512=8e27a74019739fd4945e4a1d390c82313a85a578bf52e7eec76535b6f9817b10d5c2618faf2674dee96e6470cbfd4c5e51d1d9cf219aa405b8649f5835533a4c
Dependencies
metaquot
>= "0.2.0" & < "0.3.0"
metapp
>= "0.2.0" & < "0.3.0"
stdcompat
>= "14"
dune
>= "1.10.0"
ocaml
>= "4.03.0" & < "4.12.0"
Reverse Dependencies
refl
< "0.3.0"