Skip to content

Commit 3b71c58

Browse files
committed
Add regression doctests for BitPack (Proxy a)
1 parent e0403d2 commit 3b71c58

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
@@ -57,6 +57,7 @@ import Clash.Sized.Internal.BitVector
5757
>>> :m -Prelude
5858
>>> :set -XDataKinds
5959
>>> import Clash.Prelude
60+
>>> import Data.Proxy
6061
-}
6162

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

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

482491
instance BitPack a => BitPack (Complex a)

0 commit comments

Comments
 (0)