Copyright | (C) 2013-2015, University of Twente |
---|---|
License | BSD2 (see the file LICENSE) |
Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
Safe Haskell | None |
Language | Haskell2010 |
Extensions |
|
Documentation
Convert to and from a BitVector
pack :: a -> BitVector (BitSize a) Source
Convert element of type a
to a BitVector
>>>
pack (-5 :: Signed 6)
111011
unpack :: BitVector (BitSize a) -> a Source
Convert a BitVector
to an element of type a
>>>
pack (-5 :: Signed 6)
111011>>>
let x = pack (-5 :: Signed 6)
>>>
unpack x :: Unsigned 6
59>>>
pack (59 :: Unsigned 6)
111011
BitPack Bool Source | |
BitPack (BitVector n) Source | |
KnownNat n => BitPack (Signed n) Source | |
BitPack (Unsigned n) Source | |
(KnownNat (BitSize a), KnownNat (BitSize b), BitPack a, BitPack b) => BitPack (a, b) Source | |
(KnownNat n, KnownNat (BitSize a), BitPack a) => BitPack (Vec n a) Source | |
BitPack (rep ((+) int frac)) => BitPack (Fixed rep int frac) Source |