mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
add CCInt.{of_string,to_string}
This commit is contained in:
parent
42e54fabc5
commit
4946f367ea
2 changed files with 13 additions and 0 deletions
|
|
@ -70,3 +70,9 @@ let random_range i j st = i + random (j-i) st
|
|||
|
||||
let pp buf = Printf.bprintf buf "%d"
|
||||
let print fmt = Format.pp_print_int fmt
|
||||
|
||||
let to_string = string_of_int
|
||||
|
||||
let of_string s =
|
||||
try Some (int_of_string s)
|
||||
with _ -> None
|
||||
|
|
|
|||
|
|
@ -56,3 +56,10 @@ val random_range : int -> int -> t random_gen
|
|||
|
||||
val pp : t printer
|
||||
val print : t formatter
|
||||
|
||||
val to_string : t -> string
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
val of_string : string -> t option
|
||||
(** @since NEXT_RELEASE *)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue