| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Generic.Data.Types
Contents
Description
Utilities to derive and transform generic types.
- newtype Data r p = Data {
- unData :: r p
- type family Map (s :: TyFun a b -> Type) (r :: k -> Type) :: k -> Type
- data TyFun :: Type -> Type -> Type
- type (~>) a b = TyFun a b -> Type
- type family (f :: TyFun k1 k2 -> Type) @@ (x :: k1) :: k2
- data Id :: TyFun k1 k2 -> Type
- data TyCon :: (k1 -> k2) -> TyFun k1 k2 -> Type
- data Const :: k2 -> TyFun k1 k2 -> Type
Documentation
A wrapper to view a generic Rep as the datatype it's supposed
to represent, without needing a declaration.
This can be used to derive types from generic types, and get some instances
for free, in particular Generic, Show, Enum, Bounded.
Instances
| Monad r => Monad (Data r) Source # | |
| Functor r => Functor (Data r) Source # | |
| Applicative r => Applicative (Data r) Source # | |
| Foldable r => Foldable (Data r) Source # | |
| Traversable r => Traversable (Data r) Source # | |
| Eq1 r => Eq1 (Data r) Source # | |
| Ord1 r => Ord1 (Data r) Source # | |
| GShow1 r => Show1 (Data r) Source # | |
| Alternative r => Alternative (Data r) Source # | |
| MonadPlus r => MonadPlus (Data r) Source # | |
| Contravariant r => Contravariant (Data r) Source # | |
| Generic1 * (Data r) Source # | |
| GBounded r => Bounded (Data r p) Source # | |
| GEnum r => Enum (Data r p) Source # | |
| Eq (r p) => Eq (Data r p) Source # | |
| Ord (r p) => Ord (Data r p) Source # | |
| (GShow1 r, Show p) => Show (Data r p) Source # | |
| (Functor r, Contravariant r) => Generic (Data r p) Source # | |
| Semigroup (r p) => Semigroup (Data r p) Source # | |
| Monoid (r p) => Monoid (Data r p) Source # | |
| type Rep1 * (Data r) Source # | |
| type Rep (Data r p) Source # | |
type family Map (s :: TyFun a b -> Type) (r :: k -> Type) :: k -> Type Source #
Apply a type function on every field of a type.