We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2df13b commit c6c3cceCopy full SHA for c6c3cce
cardano-api/src/Cardano/Api/HasTypeProxy.hs
@@ -15,8 +15,7 @@ where
15
import Data.ByteString qualified as BS
16
import Data.ByteString.Lazy qualified as BSL
17
import Data.Kind (Constraint, Type)
18
-import Data.Proxy (Proxy (..))
19
-import Data.Typeable (Typeable)
+import Data.Typeable
20
import Data.Word (Word16, Word8)
21
import Numeric.Natural (Natural)
22
@@ -29,6 +28,10 @@ class Typeable t => HasTypeProxy t where
29
28
30
proxyToAsType :: Proxy t -> AsType t
31
+-- | Generalised show instance for all singletons of 'AsType' displaying the type.
32
+instance Typeable t => Show (AsType t) where
33
+ show = show . typeOf
34
+
35
instance HasTypeProxy Word8 where
36
data AsType Word8 = AsWord8
37
proxyToAsType _ = AsWord8
0 commit comments