{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE QuantifiedConstraints #-}
{-# LANGUAGE TypeOperators #-}
module Data.Type.Role.Nominal
( Nominal
, Nominality(..)
, applyNominal
) where
import Data.Coerce
import Data.Type.Coercion
import Data.Type.Equality ((:~:)(..))
class (forall a b. a ~ b => Coercible (f a) (f b)) => Nominal (f :: k -> l)
instance Nominal f
data Nominality (f :: k -> l) where
Nominality :: Nominal f => Nominality f
applyNominal :: Coercion f g -> a :~: b -> Coercion (f a) (g b)
applyNominal Coercion Refl = Coercion