Skip to content

Commit b659c7e

Browse files
committed
Add regression doctests for BitPack (Proxy a)
1 parent c5e357d commit b659c7e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
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,7 +479,15 @@ instance ( BitPack a
478479
) => BitPack (Either a b)
479480

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

483492
instance BitPack a => BitPack (Complex a)
484493
instance BitPack a => BitPack (Down a)

0 commit comments

Comments
 (0)