fromIntegral -package:grisette

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.
general coercion from integral types
Convert from integral to ring.
Lifted conversion between two Integral instances.
fromIntegral, but taking explicit add and zero.
fromIntegral, but with Num constraints instead of Backprop constraints.
Polymorphic version of fromInteger
fromIntegral a == a
Variant of fromIntegral for generalized booleans.
Number fromIntegral uni-operator.
Number fromIntegral uni-operator.
Lifted version of fromIntegral, defined to let you return RealFrac instances as targets, instead of only other Integrals. Essentially the opposite of round. The gradient should technically diverge whenever the fractional part of the downstream gradient is 0.5, but does not do this for convenience reasons.
fromIntegral', but taking explicit add and zero.
fromIntegral', but with Num constraints instead of Backprop constraints.
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.
Converts an Integral value into an interval.
Convert a bounded integeral into a decimal, while performing the necessary scaling
>>> import Numeric.Decimal

>>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int)
1234.0000

>>> fromIntegralDecimalBounded 1234 :: IO (Decimal RoundHalfUp 4 Int16)
*** Exception: arithmetic overflow
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.
>>> Stream.toList $ Stream.take 4 $ Stream.enumerateFromIntegral (0 :: Int)
[0,1,2,3]
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.
>>> Stream.toList $ Stream.take 4 $ Stream.enumerateFromIntegral (0 :: Int)
[0,1,2,3]