Generics.Deriving.ConNames

generic-deriving-1.14.6: Generic programming library for generalised deriving.

Copyright | (c) 2012 University of Oxford
License | BSD3
Maintainer | generics@haskell.org
Stability | experimental
Portability | non-portable
Safe Haskell | Safe
Language | Haskell2010

Generics.Deriving.ConNames

Contents

- Functionality for retrieving the names of the possible contructors

Description

Synopsis

- class ConNames (f :: k -> Type) where
  - gconNames :: forall (a :: k). f a -> [String]
  - gconNameOf :: forall (a :: k). f a -> String
- conNames :: (Generic a, ConNames (Rep a)) => a -> [String]
- conNameOf :: (ConNames (Rep a), Generic a) => a -> String

# Functionality for retrieving the names of the possible contructors

class ConNames (f :: k -> Type) where #

Methods

gconNames :: forall (a :: k). f a -> [String] #

gconNameOf :: forall (a :: k). f a -> String #

#### Instances

Instances details

(ConNames f, ConNames g) => ConNames (f :+: g :: k -> Type) # |
Instance details Defined in Generics.Deriving.ConNames Methods gconNames :: forall (a :: k). (f :+: g) a -> [String] # gconNameOf :: forall (a :: k). (f :+: g) a -> String #
Constructor c => ConNames (C1 c f :: k -> Type) # |
Instance details Defined in Generics.Deriving.ConNames Methods gconNames :: forall (a :: k). C1 c f a -> [String] # gconNameOf :: forall (a :: k). C1 c f a -> String #
ConNames f => ConNames (D1 c f :: k -> Type) # |
Instance details Defined in Generics.Deriving.ConNames Methods gconNames :: forall (a :: k). D1 c f a -> [String] # gconNameOf :: forall (a :: k). D1 c f a -> String #

conNames :: (Generic a, ConNames (Rep a)) => a -> [String] #

Return the name of all the constructors of the type of the given term.

conNameOf :: (ConNames (Rep a), Generic a) => a -> String #

Return the name of the constructor of the given term