Copyright  (C) 20132015, University of Twente 

License  BSD2 (see the file LICENSE) 
Maintainer  Christiaan Baaij <christiaan.baaij@gmail.com> 
Safe Haskell  Safe 
Language  Haskell2010 
Extensions 

 class Resize f where
Documentation
Coerce a value to be represented by a different number of bits
resize :: (KnownNat a, KnownNat b) => f a > f b Source
A signpreserving resize operation
 For signed datatypes: Increasing the size of the number replicates the sign bit to the left. Truncating a number to length L keeps the sign bit and the rightmost L1 bits.
 For unsigned datatypes: Increasing the size of the number extends with zeros to the left. Truncating a number of length N to a length L just removes the left (most significant) NL bits.
extend :: (KnownNat a, KnownNat (b + a)) => f a > f (b + a) Source
Perform a zeroExtend
for unsigned datatypes, and signExtend
for a
signed datatypes
zeroExtend :: (KnownNat a, KnownNat b, KnownNat (b + a)) => f a > f (b + a) Source
Add extra zero bits in front of the MSB
signExtend :: (KnownNat a, KnownNat (b + a)) => f a > f (b + a) Source
Add extra sign bits in front of the MSB
truncateB :: KnownNat a => f (b + a) > f a Source
Remove bits from the MSB