Skip to content

Commit bf935cc

Browse files
lmbollenDigitalBrains1
authored andcommitted
Add regression doctests for BitPack (Proxy a)
1 parent 363184d commit bf935cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clash-prelude/src/Clash/Class/BitPack/Internal.hs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ import Clash.Sized.Internal.BitVector
5858
>>> :m -Prelude
5959
>>> :set -XDataKinds
6060
>>> import Clash.Prelude
61+
>>> import Data.Proxy
6162
-}
6263

6364
-- | Convert data to/from a 'BitVector'. This allows functions to be defined
@@ -478,6 +479,14 @@ instance ( BitPack a
478479
) => BitPack (Either a b)
479480

480481
instance BitPack a => BitPack (Maybe a)
482+
483+
-- |
484+
-- >>> pack (Proxy @())
485+
-- 0
486+
-- >>> pack (Proxy @5)
487+
-- 0
488+
-- >>> pack (Proxy @Bool)
489+
-- 0
481490
instance BitPack (Proxy a) => BitPack (Proxy a)
482491

483492
instance BitPack a => BitPack (Complex a)

0 commit comments

Comments
 (0)