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 83e0e04 commit e8bcfe9Copy full SHA for e8bcfe9
cardano-api/src/Cardano/Api/HasTypeProxy.hs
@@ -9,6 +9,7 @@ module Cardano.Api.HasTypeProxy
9
, AsType (..)
10
, Proxy (..)
11
, FromSomeType (..)
12
+ , asTypeFromValue
13
)
14
where
15
@@ -39,6 +40,9 @@ instance HasTypeProxy BS.ByteString where
39
40
data AsType BS.ByteString = AsByteString
41
proxyToAsType _ = AsByteString
42
43
+asTypeFromValue :: HasTypeProxy t => t -> AsType t
44
+asTypeFromValue _ = proxyToAsType Proxy
45
+
46
data FromSomeType (c :: Type -> Constraint) b where
47
FromSomeType :: c a => AsType a -> (a -> b) -> FromSomeType c b
48
0 commit comments