Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class (forall a b. Coercible (f a) (f b)) => Phantom (f :: k -> l)
- data Phantomicity (f :: k -> l) where
- Phantomicity :: Phantom f => Phantomicity f
- applyPhantom :: Phantomicity f -> Coercion f g -> Coercion (f a) (g b)
- class (forall a b. Coercible (f a) (f b) => Coercible a b) => NonPhantom (f :: k -> l)
- data NonPhantomicity (f :: k -> l) where
- NonPhantomicity :: NonPhantom f => NonPhantomicity f
- innerNonPhantom :: NonPhantomicity f -> Coercion (f a) (f b) -> Coercion a b
Documentation
class (forall a b. Coercible (f a) (f b)) => Phantom (f :: k -> l) Source #
A constraint witnessing that the next argument of the type constructor of
the f
type has phantom type role.
For example Proxy
atomatically becomes an instance of this class.
Instances
(forall (a :: k) (b :: k). Coercible (f a) (f b)) => Phantom (f :: k -> l) Source # | |
Defined in Data.Type.Role.Phantom |
data Phantomicity (f :: k -> l) where Source #
A datatype witness of the phantom type role.
Phantomicity :: Phantom f => Phantomicity f |
applyPhantom :: Phantomicity f -> Coercion f g -> Coercion (f a) (g b) Source #
Saturate a coercion of a phantom datatype.
class (forall a b. Coercible (f a) (f b) => Coercible a b) => NonPhantom (f :: k -> l) Source #
A constraint witnessing that the next argument of the type constructor of
the f
type has a non-phantom (representational or nominal) type role.
For example Map
and Maybe
automatically become instances of this class.
Instances
(forall (a :: k) (b :: k). Coercible (f a) (f b) => Coercible a b) => NonPhantom (f :: k -> l) Source # | |
Defined in Data.Type.Role.Phantom |
data NonPhantomicity (f :: k -> l) where Source #
A datatype witness of the non-phantom type role.
NonPhantomicity :: NonPhantom f => NonPhantomicity f |
innerNonPhantom :: NonPhantomicity f -> Coercion (f a) (f b) -> Coercion a b Source #
Extract coercion from coercibility of types in a non-phantom position.