{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
module Cardano.Api.Internal.HasTypeProxy
( HasTypeProxy (AsType, proxyToAsType)
, asType
, Proxy (..)
, FromSomeType (..)
)
where
import Data.Kind (Constraint, Type)
import Data.Proxy (Proxy (..))
import Data.Typeable (Typeable)
class Typeable t => HasTypeProxy t where
data AsType t
proxyToAsType :: Proxy t -> AsType t
data FromSomeType (c :: Type -> Constraint) b where
FromSomeType :: c a => AsType a -> (a -> b) -> FromSomeType c b
asType :: HasTypeProxy t => AsType t
asType :: forall t. HasTypeProxy t => AsType t
asType = Proxy t -> AsType t
forall t. HasTypeProxy t => Proxy t -> AsType t
proxyToAsType Proxy t
forall {k} (t :: k). Proxy t
Proxy