package hardcaml

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type 'a t = {
  1. current : Signal.t;
  2. is : 'a -> Signal.t;
  3. set_next : 'a -> always;
    (*

    switch cases does a switch on all possible states. The cases must be exhaustive and irredundant. If the cases are non-exhaustive, one can supply ~default to make them exhaustive.

    *)
  4. switch : ?default:always Hardcaml__.Import.List.t -> 'a cases -> always;
}
val sexp_of_t : ('a -> Ppx_sexp_conv_lib.Sexp.t) -> 'a t -> Ppx_sexp_conv_lib.Sexp.t
module Encoding : sig ... end
module type State = sig ... end
val create : ?encoding:Encoding.t -> (module State with type t = 'a) -> Reg_spec.t -> enable:Signal.t -> 'a t

create reg_spec ~e creates a new state machine where the state is stored in a register created from reg_spec and e.

OCaml

Innovation. Community. Security.