File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
cardano-api/src/Cardano/Api Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1515import Data.ByteString qualified as BS
1616import Data.ByteString.Lazy qualified as BSL
1717import Data.Kind (Constraint , Type )
18- import Data.Proxy (Proxy (.. ))
19- import Data.Typeable (Typeable )
18+ import Data.Typeable
2019import Data.Word (Word16 , Word8 )
2120import Numeric.Natural (Natural )
2221
@@ -29,6 +28,13 @@ class Typeable t => HasTypeProxy t where
2928
3029 proxyToAsType :: Proxy t -> AsType t
3130
31+ -- | Generalised show instance for all singletons of 'AsType' displaying the type.
32+ instance Typeable t => Show (AsType t ) where
33+ show = show . typeRep . proxy
34+ where
35+ proxy :: AsType t -> Proxy t
36+ proxy _ = Proxy
37+
3238instance HasTypeProxy Word8 where
3339 data AsType Word8 = AsWord8
3440 proxyToAsType _ = AsWord8
You can’t perform that action at this time.
0 commit comments