package frenetic

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

The type for a result that has a semi-ring structure

include HashCmp
type t
val equal : t -> t -> Ppx_deriving_runtime.bool
include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
val compare : t -> t -> int
val hash_fold_t : Base.Hash.state -> t -> Base.Hash.state
val hash : t -> Base.Hash.hash_value
val to_string : t -> string
val sum : t -> t -> t

An associative and commutative binary operation over the type t. The following should hold:

  • sum a (sum b c) = sum (sum a b) c.
  • sum a b = sum b a.
val prod : t -> t -> t

An associative binary operation over the type t. The following should hold:

  • prod a (prod b c) = prod (prod a b) c.
  • prod a (sum b c) = sum (prod a b) (prod a c).
val one : t

The identity for the prod operation. The following should hold:

  • prod one t = t.
  • prod t one = t.

As an example, if t where the type bool and prod and sum were && and ||, respectively, then one should be the value true.

val zero : t

The identity for the sum operation. The following should hold:

  • sum zero t = t.
  • sum t zero = t.
  • prod zero t = zero.
  • prod t zero = zero.

As an example, if t where the type bool and prod and sum were && and ||, respectively, then zero should be the value false.