Basement.Compat.NumLiteral

basement-0.0.15: Foundation scrap box of array & string

License | BSD-style
Maintainer | Foundation
Safe Haskell | Safe-Inferred
Language | Haskell2010

Basement.Compat.NumLiteral

Description

Literal support for Integral and Fractional

Synopsis

- class Integral a where
  - fromInteger :: Integer -> a
- class Fractional a where
  - fromRational :: Rational -> a
- class HasNegation a where
  - negate :: a -> a

# Documentation

class Integral a where #

Integral Literal support

e.g. 123 :: Integer 123 :: Word8

Methods

fromInteger :: Integer -> a #

#### Instances

Instances details

Integral CBool # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CBool #
Integral CChar # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CChar #
Integral CClock # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CClock #
Integral CDouble # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CDouble #
Integral CFloat # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CFloat #
Integral CInt # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CInt #
Integral CIntMax # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CIntMax #
Integral CIntPtr # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CIntPtr #
Integral CLLong # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CLLong #
Integral CLong # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CLong #
Integral CPtrdiff # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CPtrdiff #
Integral CSChar # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CSChar #
Integral CSUSeconds # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CSUSeconds #
Integral CShort # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CShort #
Integral CSigAtomic # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CSigAtomic #
Integral CSize # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CSize #
Integral CTime # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CTime #
Integral CUChar # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CUChar #
Integral CUInt # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CUInt #
Integral CUIntMax # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CUIntMax #
Integral CUIntPtr # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CUIntPtr #
Integral CULLong # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CULLong #
Integral CULong # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CULong #
Integral CUSeconds # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CUSeconds #
Integral CUShort # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CUShort #
Integral CWchar # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> CWchar #
Integral IntPtr # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> IntPtr #
Integral Int16 # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int16 #
Integral Int32 # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int32 #
Integral Int64 # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int64 #
Integral Int8 # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int8 #
Integral Word16 # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word16 #
Integral Word32 # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word32 #
Integral Word64 # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word64 #
Integral Word8 # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word8 #
Integral COff # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> COff #
Integral Word128 # |
Instance details Defined in Basement.Types.Word128 Methods fromInteger :: Integer -> Word128 #
Integral Word256 # |
Instance details Defined in Basement.Types.Word256 Methods fromInteger :: Integer -> Word256 #
Integral Integer # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Integer #
Integral Natural # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Natural #
Integral Double # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Double #
Integral Float # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Float #
Integral Int # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Int #
Integral Word # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromInteger :: Integer -> Word #
KnownNat n => Integral (Zn n) # |
Instance details Defined in Basement.Bounded Methods fromInteger :: Integer -> Zn n #
(KnownNat n, NatWithinBound Word64 n) => Integral (Zn64 n) # |
Instance details Defined in Basement.Bounded Methods fromInteger :: Integer -> Zn64 n #
Integral (CountOf ty) # |
Instance details Defined in Basement.Types.OffsetSize Methods fromInteger :: Integer -> CountOf ty #
Integral (Offset ty) # |
Instance details Defined in Basement.Types.OffsetSize Methods fromInteger :: Integer -> Offset ty #

class Fractional a where #

Fractional Literal support

e.g. 1.2 :: Double 0.03 :: Float

Methods

fromRational :: Rational -> a #

#### Instances

Instances details

Fractional CDouble # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> CDouble #
Fractional CFloat # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> CFloat #
Fractional Rational # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Rational #
Fractional Double # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Double #
Fractional Float # |
Instance details Defined in Basement.Compat.NumLiteral Methods fromRational :: Rational -> Float #

class HasNegation a where #

Negation support

e.g. -(f x)

Methods

negate :: a -> a #

#### Instances

Instances details

HasNegation CChar # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CChar -> CChar #
HasNegation CDouble # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CDouble -> CDouble #
HasNegation CFloat # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CFloat -> CFloat #
HasNegation CInt # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CInt -> CInt #
HasNegation CIntMax # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CIntMax -> CIntMax #
HasNegation CLLong # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CLLong -> CLLong #
HasNegation CLong # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CLong -> CLong #
HasNegation CPtrdiff # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CPtrdiff -> CPtrdiff #
HasNegation CSChar # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CSChar -> CSChar #
HasNegation CShort # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CShort -> CShort #
HasNegation CWchar # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: CWchar -> CWchar #
HasNegation Int16 # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Int16 -> Int16 #
HasNegation Int32 # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Int32 -> Int32 #
HasNegation Int64 # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Int64 -> Int64 #
HasNegation Int8 # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Int8 -> Int8 #
HasNegation Word16 # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Word16 -> Word16 #
HasNegation Word32 # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Word32 -> Word32 #
HasNegation Word64 # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Word64 -> Word64 #
HasNegation Word8 # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Word8 -> Word8 #
HasNegation Word128 # |
Instance details Defined in Basement.Types.Word128 Methods negate :: Word128 -> Word128 #
HasNegation Word256 # |
Instance details Defined in Basement.Types.Word256 Methods negate :: Word256 -> Word256 #
HasNegation Integer # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Integer -> Integer #
HasNegation Double # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Double -> Double #
HasNegation Float # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Float -> Float #
HasNegation Int # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Int -> Int #
HasNegation Word # |
Instance details Defined in Basement.Compat.NumLiteral Methods negate :: Word -> Word #