{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilies #-}
module Cardano.Api.HasTypeProxy
( HasTypeProxy (AsType, proxyToAsType)
, 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