Skip to content

Commit 7a6a4f4

Browse files
authored
clash-prelude: Add ShowX, NFDataX} instances for Proxy (#2637)
Both I and `clash-protocols` have found this instance useful, leading to overlapping instances. Let's put it where it belongs.
1 parent e1feb20 commit 7a6a4f4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Add `ShowX`, `NFDataX` instances for `Proxy`

clash-prelude/src/Clash/XException.hs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import qualified Data.List.Infinite as Inf
6363
import Data.List.Infinite (Infinite (..))
6464
import Data.List.NonEmpty (NonEmpty)
6565
import Data.Ord (Down (Down))
66+
import Data.Proxy (Proxy)
6667
import Data.Ratio (Ratio, numerator, denominator)
6768
import qualified Data.Semigroup as SG
6869
import qualified Data.Monoid as M
@@ -397,6 +398,8 @@ printX :: ShowX a => a -> IO ()
397398
printX x = putStrLn $ showX x
398399

399400
instance ShowX ()
401+
-- | @since 1.8.2
402+
instance ShowX (Proxy a)
400403
instance ShowX a => ShowX (Identity a)
401404
instance ShowX a => ShowX (Const a b)
402405
instance (ShowX (f a), ShowX (g a)) => ShowX (Product f g a)
@@ -585,6 +588,8 @@ instance NFDataX a => NFDataX [a]
585588
instance NFDataX a => NFDataX (NonEmpty a)
586589
instance (NFDataX a, NFDataX b) => NFDataX (Either a b)
587590
instance NFDataX a => NFDataX (Maybe a)
591+
-- | @since 1.8.2
592+
instance NFDataX (Proxy a)
588593
instance NFDataX a => NFDataX (Identity a)
589594
instance NFDataX a => NFDataX (Const a b)
590595
instance (NFDataX (f a), NFDataX (g a)) => NFDataX (Product f g a)

0 commit comments

Comments
 (0)