clean(Char): remove functions defined in Stdlib

This commit is contained in:
Fardale 2020-03-05 19:32:02 +01:00 committed by Simon Cruanes
parent f3719d29aa
commit b96f7d6e68
2 changed files with 0 additions and 24 deletions

View file

@ -4,11 +4,8 @@
@since 0.14 *) @since 0.14 *)
open CCShims_
include Char include Char
let equal (a:char) b = Stdlib.(=) a b
let pp_buf = Buffer.add_char let pp_buf = Buffer.add_char
let pp = Format.pp_print_char let pp = Format.pp_print_char
@ -26,11 +23,3 @@ let to_string c = String.make 1 c
(*$Q to_string (*$Q to_string
(Q.string_of_size (Q.Gen.return 1)) (fun s -> to_string s.[0] = s) (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
let uppercase_ascii = function
| 'a'..'z' as c -> Char.unsafe_chr (Char.code c - 32)
| c -> c

View file

@ -6,25 +6,12 @@
include module type of struct include Char end include module type of struct include Char end
val equal : t -> t -> bool
(** The equal function for chars. *)
val compare : t -> t -> int val compare : t -> t -> int
(** The comparison function for characters, with the same specification as (** The comparison function for characters, with the same specification as
{!Pervasives.compare}. Along with the type [t], this function [compare] {!Pervasives.compare}. Along with the type [t], this function [compare]
allows the module [Char] to be passed as argument to the functors allows the module [Char] to be passed as argument to the functors
{!Set.Make} and {!Map.Make}. *) {!Set.Make} and {!Map.Make}. *)
val lowercase_ascii : t -> t
(** Convert the given character to its equivalent lowercase character,
using the US-ASCII character set.
@since 0.20 *)
val uppercase_ascii : t -> t
(** Convert the given character to its equivalent uppercase character,
using the US-ASCII character set.
@since 0.20 *)
val of_int_exn : int -> t val of_int_exn : int -> t
(** Alias to {!Char.chr}. (** Alias to {!Char.chr}.
Return the character with the given ASCII code. Return the character with the given ASCII code.