Module

Data.Generic.Rep

#Generic

class Generic a rep | a -> rep where

The Generic class asserts the existence of a type function from types to their representations using the type constructors defined in this module.

Members

  • to :: rep -> a
  • from :: a -> rep

#repOf

repOf :: forall a rep. Generic a rep => Proxy a -> Proxy rep

#NoConstructors

data NoConstructors

A representation for types with no constructors.

#NoArguments

data NoArguments

A representation for constructors with no arguments.

Constructors

Instances

#Sum

data Sum a b

A representation for types with multiple constructors.

Constructors

Instances

#Product

data Product a b

A representation for constructors with multiple fields.

Constructors

Instances

#Constructor

newtype Constructor (name :: Symbol) a

A representation for constructors which includes the data constructor name as a type-level string.

Constructors

Instances

#Argument

newtype Argument a

A representation for an argument in a data constructor.

Constructors

Instances

Modules