Copyright | (c) Matthew Naylor 2019 (c) Alexandre Joannou 2019 |
---|---|
License | MIT |
Maintainer | mattfn@gmail.com |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
Blarney.Core.Bits
Description
Documentation
Minimal complete definition
Nothing
Associated Types
Type-level size of bit-vector
Methods
Value-level size of bit-vector
pack :: a -> Bit (SizeOf a) Source #
Convert to a bit-vector
default pack :: (Generic a, GBits (Rep a), GSizeOf (Rep a) ~ SizeOf a) => a -> Bit (SizeOf a) Source #
unpack :: Bit (SizeOf a) -> a Source #
Convert from a bit-vector
default unpack :: (Generic a, GBits (Rep a), GSizeOf (Rep a) ~ SizeOf a) => Bit (SizeOf a) -> a Source #
nameBits :: String -> a -> a Source #
Name a Bits
Instances
Bits () # | |
KnownNat n => Bits (Bit n) # | |
KnownNat n => Bits (Signed n) # | |
Bits t => Bits (Option t) # | |
IsTaggedUnion (TaggedUnion fields) => Bits (TaggedUnion fields) # | Bits instance for tagged unions |
Defined in Blarney.TaggedUnion Associated Types type SizeOf (TaggedUnion fields) :: Nat Source # Methods sizeOf :: TaggedUnion fields -> Int Source # pack :: TaggedUnion fields -> Bit (SizeOf (TaggedUnion fields)) Source # unpack :: Bit (SizeOf (TaggedUnion fields)) -> TaggedUnion fields Source # nameBits :: String -> TaggedUnion fields -> TaggedUnion fields Source # | |
(KnownNat n, Bits a) => Bits (Vec n a) # | |
(Bits a, Bits b) => Bits (a, b) # | |
(Bits a, Bits b, Bits c) => Bits (a, b, c) # | |
(Bits a, Bits b, Bits c, Bits d) => Bits (a, b, c, d) # | |
Defined in Blarney.Core.Bits | |
(Bits a, Bits b, Bits c, Bits d, Bits e) => Bits (a, b, c, d, e) # | |
Defined in Blarney.Core.Bits | |
(Bits a, Bits b, Bits c, Bits d, Bits e, Bits f) => Bits (a, b, c, d, e, f) # | |
Defined in Blarney.Core.Bits | |
(Bits a, Bits b, Bits c, Bits d, Bits e, Bits f, Bits g) => Bits (a, b, c, d, e, f, g) # | |
Defined in Blarney.Core.Bits |
Methods
gsizeOf :: f a -> Int Source #
gpack :: f a -> Bit (GSizeOf f) Source #