reified-records- Reify records to Maps and back again

Safe HaskellSafe




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 -> BoolSource

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

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 -> aSource

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.