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

Language | Haskell2010 |

Type-level functions on generic representations.

### Warning

This is an internal module: it is not subject to any versioning policy, breaking changes can happen at any time.

If something here seems useful, please report it or create a pull request to export it from an external module.

## Synopsis

- type family NConstructors (r :: k -> Type) :: Nat
- nconstructors :: forall r. KnownNat (NConstructors r) => Integer
- type family NFields (r :: k -> Type) :: Nat
- nfields :: forall r. KnownNat (NFields r) => Integer

# Documentation

type family NConstructors (r :: k -> Type) :: Nat Source #

Number of constructors of a data type.

## Instances

type NConstructors (f :+: g :: k -> Type) Source # | |

Defined in Generic.Data.Internal.Functions | |

type NConstructors (M1 C c f :: k -> Type) Source # | |

Defined in Generic.Data.Internal.Functions | |

type NConstructors (M1 D c f :: k -> Type) Source # | |

Defined in Generic.Data.Internal.Functions |

nconstructors :: forall r. KnownNat (NConstructors r) => Integer Source #

Number of constructors of a data type.