Conversion between hexadecimal numbers and Coq strings
Pretty straightforward, which is precisely the point of the
Hexadecimal.int datatype. The only catch is
Hexadecimal.Nil : we could
choose to convert it as
"" or as
"0". In the first case, it is
awkward to consider "" (or "-") as a number, while in the second case
we don't have a perfect bijection. Since the second variant is implemented
thanks to the first one, we provide both.
Hexadecimal digits are lower case ('a'..'f'). We ignore upper case
digits ('A'..'F') for the sake of simplicity.
Warning! (-0) won't parse (compatibility with the behavior of Z).