(executable
  (name docs_template)
  (libraries mustache))

(rule
 (alias runtest)
 (package bastet)
 (deps
  (package bastet)
  (:array_map ArrayMap.md)
  (:identity_fn IdentityFn.md)
  (:compose_fn ComposeFn.md)
  (:list_functor ListFunctor.md)
  (:option_functor OptionFunctor.md)
  (:associativity Associativity.md)
  (:identity IdentityElement.md)
  (:magma Magma.md)
  (:additive_monoid AdditiveMonoid.md)
  (:multiplicative_monoid MultiplicativeMonoid.md)
  (:conjunctive_monoid ConjunctiveMonoid.md)
  (:disjunctive_monoid DisjunctiveMonoid.md)
  (:list_monoid ListMonoid.md)
  (:option_monoid OptionMonoid.md)
  (:option_monad OptionMonad.md)
  (:option_monad_laws OptionMonadLaws.md)
  (:io_monad IOMonad.md)
  (:category_monoid CategoryMonoid.md)
  (:plus Plus.md)
  (:monad Monad.md)
  (:category Category.md)
  (:eq Eq.md)
  (:ord Ord.md)
  (:ring Euclidean_Ring.md)
  (:lattice Join_Semilattice.md)
  (:hush Hush.md))
 (action
  (progn
   (run ocaml-mdx test %{array_map})
   (diff? %{array_map} %{array_map}.corrected)
   (run ocaml-mdx test %{identity_fn})
   (diff? %{identity_fn} %{identity_fn}.corrected)
   (run ocaml-mdx test %{compose_fn})
   (diff? %{compose_fn} %{compose_fn}.corrected)
   (run ocaml-mdx test %{list_functor})
   (diff? %{list_functor} %{list_functor}.corrected)
   (run ocaml-mdx test %{option_functor})
   (diff? %{option_functor} %{option_functor}.corrected)
   (run ocaml-mdx test %{associativity})
   (diff? %{associativity} %{associativity}.corrected)
   (run ocaml-mdx test %{identity})
   (diff? %{identity} %{identity}.corrected)
   (run ocaml-mdx test %{magma})
   (diff? %{magma} %{magma}.corrected)
   (run ocaml-mdx test %{additive_monoid})
   (diff? %{additive_monoid} %{additive_monoid}.corrected)
   (run ocaml-mdx test %{multiplicative_monoid})
   (diff? %{multiplicative_monoid} %{multiplicative_monoid}.corrected)
   (run ocaml-mdx test %{conjunctive_monoid})
   (diff? %{conjunctive_monoid} %{conjunctive_monoid}.corrected)
   (run ocaml-mdx test %{disjunctive_monoid})
   (diff? %{disjunctive_monoid} %{disjunctive_monoid}.corrected)
   (run ocaml-mdx test %{list_monoid})
   (diff? %{list_monoid} %{list_monoid}.corrected)
   (run ocaml-mdx test %{option_monoid})
   (diff? %{option_monoid} %{option_monoid}.corrected)
   (run ocaml-mdx test %{option_monad})
   (diff? %{option_monad} %{option_monad}.corrected)
   (run ocaml-mdx test %{option_monad_laws})
   (diff? %{option_monad_laws} %{option_monad_laws}.corrected)
   (run ocaml-mdx test %{io_monad})
   (diff? %{io_monad} %{io_monad}.corrected)
   (run ocaml-mdx test %{category_monoid})
   (diff? %{category_monoid} %{category_monoid}.corrected)
   (run ocaml-mdx test %{plus})
   (diff? %{plus} %{plus}.corrected)
   (run ocaml-mdx test %{monad})
   (diff? %{monad} %{monad}.corrected)
   (run ocaml-mdx test %{category})
   (diff? %{category} %{category}.corrected)
   (run ocaml-mdx test %{eq})
   (diff? %{eq} %{eq}.corrected)
   (run ocaml-mdx test %{ord})
   (diff? %{ord} %{ord}.corrected)
   (run ocaml-mdx test %{ring})
   (diff? %{ring} %{ring}.corrected)
   (run ocaml-mdx test %{lattice})
   (diff? %{lattice} %{lattice}.corrected)
   (run ocaml-mdx test %{hush})
   (diff? %{lattice} %{hush}.corrected))))
