General coercion from Integral types.
WARNING: This function performs silent truncation if the result type
is not at least as big as the argument's type.
Re-exported fromIntegral, but please give it explicit type to
make it obvious if wrapping, etc., may occur. Use
toIntegralCrash instead, if possible, because it fails instead
of wrapping, etc. In general, it may wrap or otherwise lose
information.
Enumerate an Integral type. enumerateFromIntegral from
generates a stream whose first element is from and the
successive elements are in increments of 1. The stream is
bounded by the size of the Integral type.
Enumerate an Integral type. enumerateFromIntegral from
generates a stream whose first element is from and the
successive elements are in increments of 1. The stream is
bounded by the size of the Integral type.
Like fromIntegral, but errors if a is out of bounds for
b. Useful when you "know" a can't be out of bounds, but
would like to have your assumptions checked.
NB: Check only affects simulation. I.e., no checks will be
inserted into the generated HDL
NB: fromIntegral is not well suited for Clash as it
will go through Integer which is arbitrarily bounded in HDL.
Instead use bitCoerce and the Resize class.