Handle oddly-sized integral types with the int-cast facilities
Clarification and motivation
After #423 (closed) we use the int-cast library to handle (most) integral conversions.
We now also have several functions, with various degrees of safety and interfaces, to perform these conversions, see morley-prelude
's Morley.Prelude.FromIntegral
and Unsafe
modules.
However, we have 2 integral types with odd sizes, that we treat in a special way and define specific conversion functions for, namely:
-
Mutez
, which is actually an unsigned 63 bits type -
TLTime
, which is actually an unsigned 62 bits type
We should stop this special treatment and instead define the right instances of Bits
, Integral
and IntBaseType
to handle them as any other integral type supported by int-cast
, see Registering new integer types.
Acceptance criteria
For both Mutez
and TLTime
:
- the necessary instances are defined to use them with
int-cast
facilities - their special conversion functions are deprecated in favor of generic integral ones