reified-records-0.2.2: Reify records to Maps and back again

Safe HaskellSafe
LanguageHaskell2010

Data.Generics.Record

Synopsis

Documentation

data RecordT a Source

A phantom type used to parameterize functions based on records. This let's us avoid passing undefineds or manually creating instances all the time. It can only be created for types which are records and is used as a token to most of the API's functions.

isRecord :: forall a. Data a => a -> Bool Source

Returns True if a is a data type with a single constructor and is a record. a may be bottom.

recordT :: forall a. Data a => Maybe (RecordT a) Source

The smart constructor for RecordTs. This will return a RecordT if and only if the type is a record.

fields :: forall a. Data a => RecordT a -> [String] Source

Returns the fields for the record a

emptyRecord :: forall a. Data a => RecordT a -> a Source

Return a record where all fields are _|_

recordStructure :: forall a. Data a => RecordT a -> [(TypeRep, String)] Source

Return a records structure of as a list of types paired with field names.