| Copyright | (C) 2013-2016 University of Twente |
|---|---|
| License | BSD2 (see the file LICENSE) |
| Maintainer | Christiaan Baaij <christiaan.baaij@gmail.com> |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
| Extensions | MagicHash |
Clash.Sized.BitVector
Description
Bit
Bit
Instances
| Bounded Bit Source # | |
| Enum Bit Source # | |
| Eq Bit Source # | |
| Integral Bit Source # | |
| Data Bit Source # | |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bit -> c Bit # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bit # dataTypeOf :: Bit -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bit) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bit) # gmapT :: (forall b. Data b => b -> b) -> Bit -> Bit # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bit -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bit -> r # gmapQ :: (forall d. Data d => d -> u) -> Bit -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Bit -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bit -> m Bit # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bit -> m Bit # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bit -> m Bit # | |
| Num Bit Source # | |
| Ord Bit Source # | |
| Real Bit Source # | |
Methods toRational :: Bit -> Rational # | |
| Show Bit Source # | |
| Lift Bit Source # | |
| Bits Bit Source # | |
| FiniteBits Bit Source # | |
Methods finiteBitSize :: Bit -> Int # countLeadingZeros :: Bit -> Int # countTrailingZeros :: Bit -> Int # | |
| NFData Bit Source # | |
| ShowX Bit Source # | |
| Default Bit Source # | |
| BitPack Bit Source # | |
| Bundle Bit Source # | |
| type BitSize Bit Source # | |
| type Unbundled domain Bit Source # | |
Construction
Initialisation
BitVector
data BitVector (n :: Nat) Source #
A vector of bits.
- Bit indices are descending
Numinstance performs unsigned arithmetic.
Instances
Accessors
Length information
Construction
bLit :: KnownNat n => String -> Q (TExp (BitVector n)) Source #
Create a binary literal
>>>$$(bLit "1001") :: BitVector 41001>>>$$(bLit "1001") :: BitVector 3001
NB: You can also just write:
>>>0b1001 :: BitVector 41001
The advantage of bLit is that you can use computations to create the
string literal:
>>>import qualified Data.List as List>>>$$(bLit (List.replicate 4 '1')) :: BitVector 41111