Gist.Scalar
Operating on scalar types.
type 'a t = 'a scalar
The type for scalars of type 'a
.
val zero : 'a scalar -> 'a
zero s
is a zero value for s
.
val equal : 'a scalar -> 'a -> 'a -> bool
equal s v0 v1
is true
iff v0
and v1
are the same value as per the Stdlib's corresponding M.equal
function.
val compare : 'a scalar -> 'a -> 'a -> int
equal s v0 v1
is true
iff v0
and v1
are the same value as per the Stdlib's corresponding M.compare
function.
val pp : 'a scalar -> Stdlib.Format.formatter -> 'a -> unit
pp s
is a formatter for scalar s
val to_string : 'a scalar -> 'a -> string
to_string s v
converts v
to a string. This uses the Stdlib's corresponding M.to_string
functions, except for:
char
, UTF-8 compatible characters are output as is, otherwise hex escaped. TODO. What about simply interpreting the byte as a Unicode scalar value ? (that'd give a latin1 interpretation I think).Uchar.t
, the UTF-8 encoding of the character is returned