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

Safe HaskellSafe
LanguageHaskell2010

Data.Generics.Record.Reify

Synopsis

Documentation

reify :: forall a. Data a => RecordT a -> a -> Map String Dynamic Source

Reify a record to a Map

reifyMay :: forall a. Data a => a -> Maybe (Map String Dynamic) Source

If a is a record, this will return a Map where the keys are the field names and the values are wrapped in toDyn. Otherwise Nothing will be returned.

reflect :: forall a. Data a => Map String Dynamic -> Maybe a Source

Reflect a Map of strings to an arbitrary type. If the type is a record, each of its field names will be looked up in the record. If any of the types don't match or if a isn't a record, Nothing will be returned.