generic-data-0.4.0.0: Utilities for GHC.Generics

Safe HaskellSafe
LanguageHaskell2010

Generic.Data.Internal.Functions

Description

Type level functions on generic representations.

Synopsis

Documentation

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

Number of constructors of a data type.

Instances
type NConstructors (f :+: g :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Functions

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

Defined in Generic.Data.Internal.Functions

type NConstructors (M1 C c f :: k -> Type) = 1
type NConstructors (M1 D c f :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Functions

type NConstructors (M1 D c f :: k -> Type) = NConstructors f

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

Arity of a constructor.

Instances
type NFields (f :*: g :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Functions

type NFields (f :*: g :: k -> Type) = NFields f + NFields g
type NFields (M1 S c f :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Functions

type NFields (M1 S c f :: k -> Type) = 1
type NFields (M1 C c f :: k -> Type) Source # 
Instance details

Defined in Generic.Data.Internal.Functions

type NFields (M1 C c f :: k -> Type) = NFields f

nfields :: forall r. KnownNat (NFields r) => Integer Source #