clash-prelude-1.8.0: Clash: a functional hardware description language - Prelude library
Safe HaskellNone
LanguageHaskell2010

Clash.Num.Zeroing

Synopsis

Documentation

data Zeroing a Source #

A zeroing number type is one where all operations return zero if they go out of bounds for the underlying type.

Numbers can be converted to zero by default using toZeroing.

Instances

Instances details
Bounded a => Bounded (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

(Enum a, SaturatingNum a) => Enum (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

succ :: Zeroing a -> Zeroing a #

pred :: Zeroing a -> Zeroing a #

toEnum :: Int -> Zeroing a #

fromEnum :: Zeroing a -> Int #

enumFrom :: Zeroing a -> [Zeroing a] #

enumFromThen :: Zeroing a -> Zeroing a -> [Zeroing a] #

enumFromTo :: Zeroing a -> Zeroing a -> [Zeroing a] #

enumFromThenTo :: Zeroing a -> Zeroing a -> Zeroing a -> [Zeroing a] #

Eq a => Eq (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

(==) :: Zeroing a -> Zeroing a -> Bool #

(/=) :: Zeroing a -> Zeroing a -> Bool #

(Fractional a, Ord a, SaturatingNum a) => Fractional (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

(/) :: Zeroing a -> Zeroing a -> Zeroing a #

recip :: Zeroing a -> Zeroing a #

fromRational :: Rational -> Zeroing a #

(Integral a, SaturatingNum a) => Integral (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

quot :: Zeroing a -> Zeroing a -> Zeroing a #

rem :: Zeroing a -> Zeroing a -> Zeroing a #

div :: Zeroing a -> Zeroing a -> Zeroing a #

mod :: Zeroing a -> Zeroing a -> Zeroing a #

quotRem :: Zeroing a -> Zeroing a -> (Zeroing a, Zeroing a) #

divMod :: Zeroing a -> Zeroing a -> (Zeroing a, Zeroing a) #

toInteger :: Zeroing a -> Integer #

(Bounded a, Ord a, SaturatingNum a) => Num (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

(+) :: Zeroing a -> Zeroing a -> Zeroing a #

(-) :: Zeroing a -> Zeroing a -> Zeroing a #

(*) :: Zeroing a -> Zeroing a -> Zeroing a #

negate :: Zeroing a -> Zeroing a #

abs :: Zeroing a -> Zeroing a #

signum :: Zeroing a -> Zeroing a #

fromInteger :: Integer -> Zeroing a #

Ord a => Ord (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

compare :: Zeroing a -> Zeroing a -> Ordering #

(<) :: Zeroing a -> Zeroing a -> Bool #

(<=) :: Zeroing a -> Zeroing a -> Bool #

(>) :: Zeroing a -> Zeroing a -> Bool #

(>=) :: Zeroing a -> Zeroing a -> Bool #

max :: Zeroing a -> Zeroing a -> Zeroing a #

min :: Zeroing a -> Zeroing a -> Zeroing a #

(Real a, SaturatingNum a) => Real (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

toRational :: Zeroing a -> Rational #

(RealFrac a, SaturatingNum a) => RealFrac (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

properFraction :: Integral b => Zeroing a -> (b, Zeroing a) #

truncate :: Integral b => Zeroing a -> b #

round :: Integral b => Zeroing a -> b #

ceiling :: Integral b => Zeroing a -> b #

floor :: Integral b => Zeroing a -> b #

Show a => Show (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

showsPrec :: Int -> Zeroing a -> ShowS #

show :: Zeroing a -> String #

showList :: [Zeroing a] -> ShowS #

Arbitrary a => Arbitrary (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

arbitrary :: Gen (Zeroing a) #

shrink :: Zeroing a -> [Zeroing a] #

Bits a => Bits (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

FiniteBits a => FiniteBits (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Binary a => Binary (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

put :: Zeroing a -> Put #

get :: Get (Zeroing a) #

putList :: [Zeroing a] -> Put #

NFData a => NFData (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

rnf :: Zeroing a -> () #

Hashable a => Hashable (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

hashWithSalt :: Int -> Zeroing a -> Int #

hash :: Zeroing a -> Int #

NFDataX a => NFDataX (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

ShowX a => ShowX (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

BitPack a => BitPack (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Associated Types

type BitSize (Zeroing a) :: Nat Source #

Parity a => Parity (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

even :: Zeroing a -> Bool Source #

odd :: Zeroing a -> Bool Source #

Resize f => Resize (Compose Zeroing f) Source # 
Instance details

Defined in Clash.Num.Zeroing

Methods

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

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

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

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

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

type BitSize (Zeroing a) Source # 
Instance details

Defined in Clash.Num.Zeroing

type BitSize (Zeroing a) = BitSize a