json2-0.8.1: Library provides support for JSON.

Data.JSON2.Internal

Contents

Synopsis

Helpers of check conversion.

checkBoundsIntegral :: (Typeable a, Bounded a, Integral a) => (Rational -> a) -> Rational -> ConvResult aSource

Conversion Rational number to Integral number with check bounds.

checkBoundsEnum :: (Typeable a, Bounded a, Enum a) => (Rational -> a) -> Rational -> ConvResult aSource

Conversion Rational number to Bounded values with check bounds. checkBoundsEnum (toEnum . round)

checkInfinite :: (Typeable a, RealFloat a) => (Rational -> a) -> Rational -> ConvResult aSource

Conversion Rational to RealFloat values with check infinity.

mkError :: (Show a, Typeable a, Typeable b) => a -> ConvResult bSource

Create conversion error.

mkError' :: (Show a, Typeable a, Typeable b) => String -> a -> ConvResult bSource

Create conversion error with message.