Skip to content

Commit

Permalink
NullPadded: add missing CBLen, BLen instances
Browse files Browse the repository at this point in the history
  • Loading branch information
raehik committed Mar 17, 2024
1 parent e6e9e12 commit 1ff5cf8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Binrep/Type/NullPadded.hs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ instance (BLen a, KnownNat n) => Predicate (NullPad n) a where
n = natValInt @n
len = blen a

instance IsCBLen (NullPadded n a) where type CBLen (NullPadded n a) = n
deriving via ViaCBLen (NullPadded n a) instance KnownNat n => BLen (NullPadded n a)

instance (BLen a, Put a, KnownNat n) => Put (NullPadded n a) where
put ra = put a <> BZ.replicateByte paddingLen 0x00
where
Expand Down

0 comments on commit 1ff5cf8

Please sign in to comment.