add CCChar.to_string

This commit is contained in:
Fardale 2019-10-28 14:05:48 +01:00
parent eb860afc29
commit 3dfbbeb3e3
2 changed files with 10 additions and 0 deletions

View file

@ -16,6 +16,12 @@ let of_int_exn = Char.chr
let of_int c = try Some (of_int_exn c) with _ -> None
let to_int = Char.code
let to_string c = String.make 1 c
(*$Q to_string
(Q.string_of_size (Q.Gen.return 1)) (fun s -> to_string s.[0] = s)
*)
let lowercase_ascii = function
| 'A'..'Z' as c -> Char.unsafe_chr (Char.code c + 32)
| c -> c

View file

@ -40,6 +40,10 @@ val to_int : t -> int
Return the ASCII code of the argument.
@since 1.0 *)
val to_string : t -> string
(** [to_string c] return a string containing [c]
@since NEXT_RELEASE *)
val pp_buf : Buffer.t -> t -> unit
(** Renamed from [pp] since 2.0. *)