Safe Haskell | None |
---|---|

Language | Haskell2010 |

## Synopsis

- class (forall a. Coercible (m a) (g a), forall a. Coercible (g a) (m a)) => NatNewtype (m :: Type -> Type) (g :: Type -> Type) | g -> m
- natNewtypeFrom :: NatNewtype m g => g a -> m a
- natNewtypeTo :: NatNewtype m g => m a -> g a

# Documentation

class (forall a. Coercible (m a) (g a), forall a. Coercible (g a) (m a)) => NatNewtype (m :: Type -> Type) (g :: Type -> Type) | g -> m Source #

A "natural isomorphism" between two functors, like exists
derivably between newtyped functors and their wrapped types.
The functional dependency requires that `g`

be the newtype
and `m`

the wrapped type.

## Instances

NatNewtype (ScopeW Identity n f (Scope n f)) (Scope n f) Source # | |

Defined in Blanks.Scope | |

NatNewtype (ScopeW (Located l) n f (LocScope l n f)) (LocScope l n f) Source # | |

Defined in Blanks.LocScope |

natNewtypeFrom :: NatNewtype m g => g a -> m a Source #

Coerce from the newtype to the wrapped type.

natNewtypeTo :: NatNewtype m g => m a -> g a Source #

Coerce from the wrapped type to the newtype.