basement-0.0.16: 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 Source #

Integral Literal support

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

Methods

fromInteger :: Integer -> a Source #

#### Instances

Instances details

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

class Fractional a where Source #

Fractional Literal support

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

Methods

fromRational :: Rational -> a Source #

#### Instances

Instances details

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

class HasNegation a where Source #

Negation support

e.g. -(f x)

Methods

negate :: a -> a Source #

#### Instances

Instances details

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