| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Unwitch.Convert.Float
Description
Conversions from Float.
Synopsis
- toDouble :: Float -> Double
- toRational :: Float -> Either RationalErrors Rational
- toInteger :: Float -> Either IntegerErrors Integer
- toInt8 :: Float -> Either ViaIntegerErrors Int8
- toInt16 :: Float -> Either ViaIntegerErrors Int16
- toInt32 :: Float -> Either ViaIntegerErrors Int32
- toInt64 :: Float -> Either ViaIntegerErrors Int64
- toInt :: Float -> Either ViaIntegerErrors Int
- toWord8 :: Float -> Either ViaIntegerErrors Word8
- toWord16 :: Float -> Either ViaIntegerErrors Word16
- toWord32 :: Float -> Either ViaIntegerErrors Word32
- toWord64 :: Float -> Either ViaIntegerErrors Word64
- toWord :: Float -> Either ViaIntegerErrors Word
- toNatural :: Float -> Either ViaIntegerErrors Natural
- toCInt :: Float -> Either ViaIntegerErrors CInt
- data ViaIntegerErrors
- data IntegerErrors
- data RationalErrors
Documentation
toInteger :: Float -> Either IntegerErrors Integer Source #
Converts to Integer, fails if NaN, infinite, or has a fractional part.
toInt8 :: Float -> Either ViaIntegerErrors Int8 Source #
Converts via Integer, fails if not a whole number or out of range.
toInt16 :: Float -> Either ViaIntegerErrors Int16 Source #
Converts via Integer, fails if not a whole number or out of range.
toInt32 :: Float -> Either ViaIntegerErrors Int32 Source #
Converts via Integer, fails if not a whole number or out of range.
toInt64 :: Float -> Either ViaIntegerErrors Int64 Source #
Converts via Integer, fails if not a whole number or out of range.
toInt :: Float -> Either ViaIntegerErrors Int Source #
Converts via Integer, fails if not a whole number or out of range.
toWord8 :: Float -> Either ViaIntegerErrors Word8 Source #
Converts via Integer, fails if not a whole number or out of range.
toWord16 :: Float -> Either ViaIntegerErrors Word16 Source #
Converts via Integer, fails if not a whole number or out of range.
toWord32 :: Float -> Either ViaIntegerErrors Word32 Source #
Converts via Integer, fails if not a whole number or out of range.
toWord64 :: Float -> Either ViaIntegerErrors Word64 Source #
Converts via Integer, fails if not a whole number or out of range.
toWord :: Float -> Either ViaIntegerErrors Word Source #
Converts via Integer, fails if not a whole number or out of range.
toNatural :: Float -> Either ViaIntegerErrors Natural Source #
Converts via Integer, fails if not a whole number, out of range, or negative.
toCInt :: Float -> Either ViaIntegerErrors CInt Source #
Converts via Integer, fails if not a whole number or out of range.
data ViaIntegerErrors Source #
Constructors
| MkInteger IntegerErrors | |
| BitConversionFailed Integer |
Instances
| Show ViaIntegerErrors Source # | |
Defined in Unwitch.Convert.Float Methods showsPrec :: Int -> ViaIntegerErrors -> ShowS # show :: ViaIntegerErrors -> String # showList :: [ViaIntegerErrors] -> ShowS # | |
| Eq ViaIntegerErrors Source # | |
Defined in Unwitch.Convert.Float Methods (==) :: ViaIntegerErrors -> ViaIntegerErrors -> Bool # (/=) :: ViaIntegerErrors -> ViaIntegerErrors -> Bool # | |
data IntegerErrors Source #
Instances
| Show IntegerErrors Source # | |
Defined in Unwitch.Convert.Float Methods showsPrec :: Int -> IntegerErrors -> ShowS # show :: IntegerErrors -> String # showList :: [IntegerErrors] -> ShowS # | |
| Eq IntegerErrors Source # | |
Defined in Unwitch.Convert.Float Methods (==) :: IntegerErrors -> IntegerErrors -> Bool # (/=) :: IntegerErrors -> IntegerErrors -> Bool # | |
data RationalErrors Source #
Instances
| Show RationalErrors Source # | |
Defined in Unwitch.Convert.Float Methods showsPrec :: Int -> RationalErrors -> ShowS # show :: RationalErrors -> String # showList :: [RationalErrors] -> ShowS # | |
| Eq RationalErrors Source # | |
Defined in Unwitch.Convert.Float Methods (==) :: RationalErrors -> RationalErrors -> Bool # (/=) :: RationalErrors -> RationalErrors -> Bool # | |