Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cardano-api/src/Cardano/Api/Internal/HasTypeProxy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module Cardano.Api.Internal.HasTypeProxy
( HasTypeProxy (AsType, proxyToAsType)
, Proxy (..)
, FromSomeType (..)
, asTypeFromValue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't you have to export it from Cardano.Api as well?

)
where

Expand All @@ -22,5 +23,8 @@ class Typeable t => HasTypeProxy t where

proxyToAsType :: Proxy t -> AsType t

asTypeFromValue :: HasTypeProxy t => t -> AsType t
asTypeFromValue _ = proxyToAsType Proxy

Copy link
Contributor

@carbolymer carbolymer Apr 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be useful too:

Suggested change
asType :: HasTypeProxy t => AsType t
asType = proxyToAsType Proxy

data FromSomeType (c :: Type -> Constraint) b where
FromSomeType :: c a => AsType a -> (a -> b) -> FromSomeType c b
Loading