clash-prelude-1.8.4: Clash: a functional hardware description language - Prelude library

Safe Haskell | None
Language | Haskell2010

Clash.Num.Erroring

Synopsis

- data Erroring a
- fromErroring :: Erroring a -> a
- toErroring :: SaturatingNum a => a -> Erroring a

# Documentation

data Erroring a Source #

An erroring number type is one where all operations return a `XExecption` if they would go out of bounds for the underlying type.

Numbers can be converted to error by default using `toErroring`.

#### Instances

Instances details

Arbitrary a => Arbitrary (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods arbitrary :: Gen (Erroring a) Source # shrink :: Erroring a -> [Erroring a] Source #
Binary a => Binary (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods put :: Erroring a -> Put Source # get :: Get (Erroring a) Source # putList :: [Erroring a] -> Put Source #
BitPack a => BitPack (Erroring a) Source # |

Instance details

Defined in Clash.Num.Erroring

Associated Types

type BitSize (Erroring a) |
Instance details Defined in Clash.Num.Erroring type BitSize (Erroring a) = BitSize a

Methods

pack :: Erroring a -> BitVector (BitSize (Erroring a)) Source #

unpack :: BitVector (BitSize (Erroring a)) -> Erroring a Source #

Parity a => Parity (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods even :: Erroring a -> Bool Source # odd :: Erroring a -> Bool Source #
NFDataX a => NFDataX (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods deepErrorX :: String -> Erroring a Source # hasUndefined :: Erroring a -> Bool Source # ensureSpine :: Erroring a -> Erroring a Source # rnfX :: Erroring a -> () Source #
ShowX a => ShowX (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods showsPrecX :: Int -> Erroring a -> ShowS Source # showX :: Erroring a -> String Source # showListX :: [Erroring a] -> ShowS Source #
NFData a => NFData (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods rnf :: Erroring a -> () Source #
Bits a => Bits (Erroring a) Source # |

Instance details

Defined in Clash.Num.Erroring

Methods

(.&.) :: Erroring a -> Erroring a -> Erroring a Source #

(.|.) :: Erroring a -> Erroring a -> Erroring a Source #

xor :: Erroring a -> Erroring a -> Erroring a Source #

complement :: Erroring a -> Erroring a Source #

shift :: Erroring a -> Int -> Erroring a Source #

rotate :: Erroring a -> Int -> Erroring a Source #

zeroBits :: Erroring a Source #

bit :: Int -> Erroring a Source #

setBit :: Erroring a -> Int -> Erroring a Source #

clearBit :: Erroring a -> Int -> Erroring a Source #

complementBit :: Erroring a -> Int -> Erroring a Source #

testBit :: Erroring a -> Int -> Bool Source #

bitSizeMaybe :: Erroring a -> Maybe Int Source #

bitSize :: Erroring a -> Int Source #

isSigned :: Erroring a -> Bool Source #

shiftL :: Erroring a -> Int -> Erroring a Source #

unsafeShiftL :: Erroring a -> Int -> Erroring a Source #

shiftR :: Erroring a -> Int -> Erroring a Source #

unsafeShiftR :: Erroring a -> Int -> Erroring a Source #

rotateL :: Erroring a -> Int -> Erroring a Source #

rotateR :: Erroring a -> Int -> Erroring a Source #

popCount :: Erroring a -> Int Source #

FiniteBits a => FiniteBits (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods finiteBitSize :: Erroring a -> Int Source # countLeadingZeros :: Erroring a -> Int Source # countTrailingZeros :: Erroring a -> Int Source #
Bounded a => Bounded (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods minBound :: Erroring a Source # maxBound :: Erroring a Source #
(Enum a, SaturatingNum a) => Enum (Erroring a) Source # |

Instance details

Defined in Clash.Num.Erroring

Methods

succ :: Erroring a -> Erroring a Source #

pred :: Erroring a -> Erroring a Source #

toEnum :: Int -> Erroring a Source #

fromEnum :: Erroring a -> Int Source #

enumFrom :: Erroring a -> [Erroring a] Source #

enumFromThen :: Erroring a -> Erroring a -> [Erroring a] Source #

enumFromTo :: Erroring a -> Erroring a -> [Erroring a] Source #

enumFromThenTo :: Erroring a -> Erroring a -> Erroring a -> [Erroring a] Source #

(Bounded a, Ord a, SaturatingNum a) => Num (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods (+) :: Erroring a -> Erroring a -> Erroring a Source # (-) :: Erroring a -> Erroring a -> Erroring a Source # (*) :: Erroring a -> Erroring a -> Erroring a Source # negate :: Erroring a -> Erroring a Source # abs :: Erroring a -> Erroring a Source # signum :: Erroring a -> Erroring a Source # fromInteger :: Integer -> Erroring a Source #
(Fractional a, Ord a, SaturatingNum a) => Fractional (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods (/) :: Erroring a -> Erroring a -> Erroring a Source # recip :: Erroring a -> Erroring a Source # fromRational :: Rational -> Erroring a Source #
(Integral a, SaturatingNum a) => Integral (Erroring a) Source # |

Instance details

Defined in Clash.Num.Erroring

Methods

quot :: Erroring a -> Erroring a -> Erroring a Source #

rem :: Erroring a -> Erroring a -> Erroring a Source #

div :: Erroring a -> Erroring a -> Erroring a Source #

mod :: Erroring a -> Erroring a -> Erroring a Source #

quotRem :: Erroring a -> Erroring a -> (Erroring a, Erroring a) Source #

divMod :: Erroring a -> Erroring a -> (Erroring a, Erroring a) Source #

toInteger :: Erroring a -> Integer Source #

(Real a, SaturatingNum a) => Real (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods toRational :: Erroring a -> Rational Source #
(RealFrac a, SaturatingNum a) => RealFrac (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods properFraction :: Integral b => Erroring a -> (b, Erroring a) Source # truncate :: Integral b => Erroring a -> b Source # round :: Integral b => Erroring a -> b Source # ceiling :: Integral b => Erroring a -> b Source # floor :: Integral b => Erroring a -> b Source #
Show a => Show (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods showsPrec :: Int -> Erroring a -> ShowS Source # show :: Erroring a -> String Source # showList :: [Erroring a] -> ShowS Source #
Eq a => Eq (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods (==) :: Erroring a -> Erroring a -> Bool Source # (/=) :: Erroring a -> Erroring a -> Bool Source #
Ord a => Ord (Erroring a) Source # |

Instance details

Defined in Clash.Num.Erroring

Methods

compare :: Erroring a -> Erroring a -> Ordering Source #

(<) :: Erroring a -> Erroring a -> Bool Source #

(<=) :: Erroring a -> Erroring a -> Bool Source #

(>) :: Erroring a -> Erroring a -> Bool Source #

(>=) :: Erroring a -> Erroring a -> Bool Source #

max :: Erroring a -> Erroring a -> Erroring a Source #

min :: Erroring a -> Erroring a -> Erroring a Source #

Hashable a => Hashable (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring Methods hashWithSalt :: Int -> Erroring a -> Int Source # hash :: Erroring a -> Int Source #
Resize f => Resize (Compose Erroring f) Source # |

Instance details

Defined in Clash.Num.Erroring

Methods

resize :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Erroring f a -> Compose Erroring f b Source #

extend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Erroring f a -> Compose Erroring f (b + a) Source #

zeroExtend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Erroring f a -> Compose Erroring f (b + a) Source #

signExtend :: forall (a :: Nat) (b :: Nat). (KnownNat a, KnownNat b) => Compose Erroring f a -> Compose Erroring f (b + a) Source #

truncateB :: forall (a :: Nat) (b :: Natural). KnownNat a => Compose Erroring f (a + b) -> Compose Erroring f a Source #

type BitSize (Erroring a) Source # |
Instance details Defined in Clash.Num.Erroring type BitSize (Erroring a) = BitSize a

fromErroring :: Erroring a -> a Source #

toErroring :: SaturatingNum a => a -> Erroring a Source #