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

Clash.Num.Wrapping

Synopsis

Documentation

newtype Wrapping a Source #

A wrapping number type is one where all operations wrap between minBound and maxBound (and vice-versa) if the result goes out of bounds for the underlying type.

Numbers can be converted to wrap by default using toWrapping.

Constructors

Wrapping 

Fields

Instances

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

Defined in Clash.Num.Wrapping

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

Defined in Clash.Num.Wrapping

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

Defined in Clash.Num.Wrapping

Methods

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

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

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

Defined in Clash.Num.Wrapping

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

Defined in Clash.Num.Wrapping

SaturatingNum a => Num (Wrapping a) Source # 
Instance details

Defined in Clash.Num.Wrapping

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

Defined in Clash.Num.Wrapping

Methods

compare :: Wrapping a -> Wrapping a -> Ordering #

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

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

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

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

max :: Wrapping a -> Wrapping a -> Wrapping a #

min :: Wrapping a -> Wrapping a -> Wrapping a #

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

Defined in Clash.Num.Wrapping

Methods

toRational :: Wrapping a -> Rational #

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

Defined in Clash.Num.Wrapping

Methods

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

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

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

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

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

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

Defined in Clash.Num.Wrapping

Methods

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

show :: Wrapping a -> String #

showList :: [Wrapping a] -> ShowS #

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

Defined in Clash.Num.Wrapping

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

Defined in Clash.Num.Wrapping

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

Defined in Clash.Num.Wrapping

Methods

put :: Wrapping a -> Put #

get :: Get (Wrapping a) #

putList :: [Wrapping a] -> Put #

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

Defined in Clash.Num.Wrapping

Methods

rnf :: Wrapping a -> () #

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

Defined in Clash.Num.Wrapping

Methods

hashWithSalt :: Int -> Wrapping a -> Int #

hash :: Wrapping a -> Int #

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

Defined in Clash.Num.Wrapping

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

Defined in Clash.Num.Wrapping

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

Defined in Clash.Num.Wrapping

Associated Types

type BitSize (Wrapping a) :: Nat Source #

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

Defined in Clash.Num.Wrapping

Methods

even :: Wrapping a -> Bool Source #

odd :: Wrapping a -> Bool Source #

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

Defined in Clash.Num.Wrapping

Methods

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

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

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

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

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

type BitSize (Wrapping a) Source # 
Instance details

Defined in Clash.Num.Wrapping

type BitSize (Wrapping a) = BitSize a