package alg_structs

  1. Overview
  2. Docs

Law notes the laws that should be obeyed by any instantiation of Applicative in the form of predicates that should be true for any arguments of the appropriate type.

You can use Alg_qcheck.Applicative to generate property based tests of these laws for new modules satisfying this interface.

Parameters

module A : S

Signature

val identity : 'a A.t -> bool

identity x: return Fun.id <*> x = x

val composition : ('b -> 'c) A.t -> ('a -> 'b) A.t -> 'a A.t -> bool

composition u v w: (return (%) <*> u <*> v <*> w) = (u <*> (v <*> w))

val homomorphism : ('a -> 'b) -> 'a -> bool

homomorphism f x: return f <*> return x = return (f x)

val interchange : ('a -> 'b) A.t -> 'a -> bool

interchange u y: (u <*> return y) = (return (fun f -> f y) <*> u)

OCaml

Innovation. Community. Security.