Preface_specs.Decidable
Decidable
is a "Contravariant Alternative".
To have a predictable behaviour, the instance of Decidable
must obey some laws.
Divisible
lawschoose Either.left x (lose f) = x
choose Either.right (lose f) x = x
choose f (choose g m n) o
=
let f' =
Either.(case (case id (right % left) % g) (right % right) % right)
in
choose f' m (choose Fun.id n o)
module type WITH_LOSE_AND_CHOOSE = sig ... end
Exposes the lose
and choose
functions, mandatory for each requirement.
module type WITH_CONTRAMAP_AND_DIVIDE_AND_CONQUER = sig ... end
Minimal definition using contramap
, divide
, conquer
, lose
and choose
.
module type CORE = WITH_CONTRAMAP_AND_DIVIDE_AND_CONQUER
Basis operations.
module type OPERATION = sig ... end
Additional operations.
module type INFIX = sig ... end
Infix operators.
module type API = sig ... end
The complete interface of a Decidable
.