module Key : sig
type t
exception Bad_key of string
val compare : t -> t -> int
val bare_key_of_string : string -> t
val quoted_key_of_string : string -> t
val to_string : t -> string
end
From what I gather the bare key constructor is duplicating validation that the parser has already done. And in fact the quoting of the string only seems to be a concern when serializing the string in order to generate valid TOML.
How would maintainers feel about changing the signature to look like:
module Key : sig
type t
val compare : t -> t -> int
val of_string : string -> t
val to_string : t -> string
end
Any string is a valid key so of_string will accept it, but on the way out of to_string, the string will have to be quoted and/or escaped.
I can take a crack at this if it's a welcomed change.
They signature is currently:
From what I gather the bare key constructor is duplicating validation that the parser has already done. And in fact the quoting of the string only seems to be a concern when serializing the string in order to generate valid TOML.
How would maintainers feel about changing the signature to look like:
Any string is a valid key so
of_string
will accept it, but on the way out ofto_string
, the string will have to be quoted and/or escaped.I can take a crack at this if it's a welcomed change.