package core
Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=743a141234e04210e295980f7a78a6d9
sha512=61b415f4fb12c78d30649fff1aabe3a475eea926ce6edb7774031f4dc7f37ea51f5d9337ead6ec73cd93da5fd1ed0f2738c210c71ebc8fe9d7f6135a06bd176f
doc/core/Core/Maybe_bound/index.html
Module Core.Maybe_bound
Source
This module extends Base.Maybe_bound
with bin_io and with compare functions in the form of As_lower_bound
and As_upper_bound
modules.
include Bin_prot.Binable.S_local1 with type 'a t := 'a t
include Ppx_hash_lib.Hashable.S1 with type 'a t := 'a t
val hash_fold_t :
(Base.Hash.state -> 'a -> Base.Hash.state) ->
Base.Hash.state ->
'a t ->
Base.Hash.state
include Ppx_quickcheck_runtime.Quickcheckable.S1 with type 'a t := 'a t
val interval_contains_exn :
lower:'a t ->
upper:'a t ->
'a ->
compare:('a -> 'a -> int) ->
bool
interval_contains_exn ~lower ~upper x ~compare
raises if lower
and upper
are crossed.
bounds_crossed ~lower ~upper ~compare
returns true if lower > upper
.
It ignores whether the bounds are Incl
or Excl
.
val compare_to_interval_exn :
lower:'a t ->
upper:'a t ->
'a ->
compare:('a -> 'a -> int) ->
interval_comparison
compare_to_interval_exn ~lower ~upper x ~compare
raises if lower
and upper
are crossed.
Compares t
values as lower bounds, where Unbounded
is lowest, Incl x < Excl x
, and other cases of Incl
and/or Excl
are compared based on 'a
. If As_lower_bound.compare compare t1 t2 <= 0
and is_lower_bound t2 ~of_:a ~compare
, then is_lower_bound t1 ~of_:a ~compare
. For example, for int As_lower_bound.t
:
Compares t
values as upper bounds, where Unbounded
is highest, Incl x > Excl x
, and other cases of Incl
and/or Excl
are compared based on 'a
. If As_upper_bound.compare compare_a t1 t2 <= 0
and is_upper_bound t1 ~of_:a ~compare
, then is_upper_bound t2 ~of_:a ~compare
. For example, for int As_upper_bound.t
: