Safe Haskell | None |
---|---|
Language | Haskell2010 |
Unsafe utilities.
This module should be imported qualified.
Synopsis
- module Universum.Unsafe
- fromIntegral :: (HasCallStack, Integral a, Integral b) => a -> b
- fromInteger :: (HasCallStack, Integral a) => Integer -> a
Documentation
module Universum.Unsafe
Unsafe converters between Integral
types checking for overflow/underflow
fromIntegral :: (HasCallStack, Integral a, Integral b) => a -> b Source #
Unsafe converter between Integral
types
checking for overflow/underflow. Return
value
if conversion does not produce
overflow/underflow and raise an exception
with corresponding error message otherwise.
It is needed to replace fromIntegral
which misses most of the overflow/underflow checks.
Note the function is strict in its argument.
fromInteger :: (HasCallStack, Integral a) => Integer -> a Source #