package batteries
Install
    
    dune-project
 Dependency
Authors
Maintainers
Sources
md5=1bcb27dfbd130eb057561196ef851649
    
    
  sha512=2a56611b09a5f1cba6457539f8b6bc87a5f2a5454b36cdb39f6e0d6a5dac6db179aab1ba87c74dd49cc41df31a9a96feb349028ea41df7371ecb47f4d9dfafc4
    
    
  doc/batteries.unthreaded/BatBounded/index.html
Module BatBounded
Bounded values
This module implements values which must fall within given bounds.
The type of a bounding function with limits specified by bounds
val bounding_of_ord : 
  default_low:'b ->
  default_high:'b ->
  ('a -> 'b) ->
  ('a -> 'a -> BatOrd.order) ->
  ('a, 'b) bounding_fbounding_of_ord ~default_low ~default_high conv ord will returning a bounding function using ord for value comparison and default_low and default_high for values which fall outside of the requested range. conv is used to convert values which are in-range to the result type.
val bounding_of_ord_chain : 
  low:('a -> 'b) ->
  high:('a -> 'b) ->
  ('a -> 'b) ->
  ('a -> 'a -> BatOrd.order) ->
  ('a, 'b) bounding_fbounding_of_ord_chain ?low ?high ord is like bounding_of_ord except that functions are used to handle out of range values rather than single default values.
val saturate_of_ord : 
  bounds:('a bound_t * 'a bound_t) ->
  ('a -> 'a -> BatOrd.order) ->
  'a ->
  'asaturate_of_ord ~bounds:(low, high) ord will returning a bounding function using ord for value comparison and low and high for values which fall outside of the requested range.
val opt_of_ord : 
  bounds:('a bound_t * 'a bound_t) ->
  ('a -> 'a -> BatOrd.order) ->
  'a ->
  'a optionopt_of_ord ~bounds:(low, high) ord will returning a bounding function using ord for value comparison and None for values which fall outside of the requested range.
module type BoundedType = sig ... endmodule type BoundedNumericType = sig ... endmodule type S = sig ... endmodule type NumericSig = sig ... endmodule Make
  (M : BoundedType) : 
  S with type base_u = M.base_t with type u = M.t with type t = private M.tFunctor to build an implementation of a bounded type given the bounded values definition M
module MakeNumeric
  (M : BoundedNumericType) : 
  NumericSig
    with type base_u = M.base_t
    with type u = M.t
    with type t = private M.t