Module Hardcaml_kernel.With_validSource

Sourcetype ('a, 'b) t2 = ('a, 'b) Comb.with_valid2 = {
  1. valid : 'a;
  2. value : 'b;
}
Sourceval sexp_of_t2 : ('a -> Sexplib0.Sexp.t) -> ('b -> Sexplib0.Sexp.t) -> ('a, 'b) t2 -> Sexplib0.Sexp.t
Sourceval t2_of_sexp : (Sexplib0.Sexp.t -> 'a) -> (Sexplib0.Sexp.t -> 'b) -> Sexplib0.Sexp.t -> ('a, 'b) t2
Sourceval bin_size_t2 : 'a 'b. 'a Bin_prot.Size.sizer -> 'b Bin_prot.Size.sizer -> ('a, 'b) t2 Bin_prot.Size.sizer
Sourceval bin_write_t2 : 'a 'b. 'a Bin_prot.Write.writer -> 'b Bin_prot.Write.writer -> ('a, 'b) t2 Bin_prot.Write.writer
Sourceval bin_read_t2 : 'a 'b. 'a Bin_prot.Read.reader -> 'b Bin_prot.Read.reader -> ('a, 'b) t2 Bin_prot.Read.reader
Sourceval __bin_read_t2__ : 'a 'b. 'a Bin_prot.Read.reader -> 'b Bin_prot.Read.reader -> ('a, 'b) t2 Bin_prot.Read.vtag_reader
Sourceval equal_t2 : 'a 'b. ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a, 'b) t2 -> ('a, 'b) t2 -> bool
Sourceval equal_t2__local : 'a 'b. ('a @ local -> 'a @ local -> bool) -> ('b @ local -> 'b @ local -> bool) -> ('a, 'b) t2 @ local -> ('a, 'b) t2 @ local -> bool
Sourceval compare_t2 : 'a 'b. ('a -> 'a -> int) -> ('b -> 'b -> int) -> ('a, 'b) t2 -> ('a, 'b) t2 -> int
Sourceval compare_t2__local : 'a 'b. ('a @ local -> 'a @ local -> int) -> ('b @ local -> 'b @ local -> int) -> ('a, 'b) t2 @ local -> ('a, 'b) t2 @ local -> int
Sourcetype 'a t = ('a, 'a) t2
include Sexplib0.Sexpable.S1 with type 'a t := 'a t
Sourceval t_of_sexp : 'a. (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
Sourceval sexp_of_t : 'a. ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
include Ppx_compare_lib.Equal.S1 with type 'a t := 'a t
Sourceval equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
include Ppx_compare_lib.Equal.S1__local with type 'a t := 'a t
include Ppx_compare_lib.Comparable.S1 with type 'a t := 'a t
Sourceval compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
include Ppx_compare_lib.Comparable.S1__local with type 'a t := 'a t
include Bin_prot.Binable.S1 with type 'a t := 'a t
include sig ... end
Sourceval bin_size_t : 'a. ('a, 'a t) Bin_prot.Size.sizer1
Sourceval bin_write_t : 'a. ('a, 'a t) Bin_prot.Write.writer1
Sourceval bin_read_t : 'a. ('a, 'a t) Bin_prot.Read.reader1
Sourceval __bin_read_t__ : 'a. ('a, 'a t) Bin_prot.Read.vtag_reader1
Sourceval bin_writer_t : 'a. ('a, 'a t) Bin_prot.Type_class.S1.writer
Sourceval bin_reader_t : 'a. ('a, 'a t) Bin_prot.Type_class.S1.reader
Sourceval bin_t : 'a. ('a, 'a t) Bin_prot.Type_class.S1.t
include Ppx_hash_lib.Hashable.S1 with type 'a t := 'a t
Sourceval valid : ('a, 'b) t2 -> 'a
Sourceval value : ('a, 'b) t2 -> 'b
Sourceval value_with_default : (module Comb.S with type t = 'a) -> 'a t -> default:'a -> 'a
Sourceval map : 'a t -> f:('a -> 'b) @ local -> 'b t
Sourceval map2 : 'a t -> 'b t -> f:('a -> ('b -> 'c) @ local) @ local -> 'c t
Sourceval iter : 'a t -> f:('a -> unit) @ local -> unit
Sourceval iter2 : 'a t -> 'b t -> f:('a -> ('b -> unit) @ local) @ local -> unit
Sourceval to_list : 'a t -> 'a list
Sourceval map_valid : ('a, 'b) t2 -> f:('a -> 'c) -> ('c, 'b) t2
Sourceval map_value : ('a, 'b) t2 -> f:('b -> 'c) -> ('a, 'c) t2

Applies the provided function to the value, keeping valid the same. Semantically similar to OCaml's Option.map

Sourceval map_value2 : (module Comb.S with type t = 'a) -> ('a, 'b) t2 -> ('a, 'c) t2 -> f:('b -> ('c -> 'd) @ local) @ local -> ('a, 'd) t2

Similar to map_value, but for a function that takes two arguments. The result is valid if both arguments were valid.

Sourceval and_then : (module Comb.S with type t = 'a) -> ('a, 'b) t2 -> f:('b -> ('a, 'c) t2) @ local -> ('a, 'c) t2

Applies the provided With_valid-returning function to the value. The result is valid if the initial argument was valid, and the value returned by the function is valid. Semantically similar to Option.bind

Sourceval and_then2 : (module Comb.S with type t = 'a) -> ('a, 'b) t2 -> ('a, 'c) t2 -> f:('b -> ('c -> ('a, 'd) t2) @ local) @ local -> ('a, 'd) t2

Similar to and_then, but for a function that takes two arguments. The result is valid if both arguments are valid and the value returned by the function is valid.

Sourceval to_option : (Bits.t, 'a) t2 -> 'a option
Sourceval wave_formats : Wave_format.t t
Sourceval port_names_and_widths_dynamic : nbits:int -> (string * int) t
Sourcemodule Fields : sig ... end

Create a new hardcaml interface with type 'a With_valid.t X.t

Sourcemodule Wrap : sig ... end

Create a new hardcaml interface with type ('a, 'a X.t) With_valid.t2.

Sourcemodule Vector (X : sig ... end) : Interface.S with type 'a t = 'a t
Sourcemodule Of_signal : sig ... end

Helper functions, similar to those of Of_signal in Interface.S, to ease usage of Signal.t t. Function types differ from Of_signal where the width of value is needed.

Sourcemodule Of_always : sig ... end

Helper functions, similar to those of Of_always in Interface.S, to ease usage of Always.Variable.t t. Function types differ from Of_always where the width of value is needed.