extensible-0.5: Extensible, efficient, optics-friendly data types and effects

Copyright(c) Fumiaki Kinoshita 2018
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Data.Extensible.Record

Description

Bidirectional conversion from/to records

Synopsis

Documentation

class IsRecord a where Source #

The class of types that can be converted to/from a Record.

Associated Types

type RecFields a :: [Assoc Symbol *] Source #

Instances
IsRecord () Source # 
Instance details

Defined in Data.Extensible.Record

Associated Types

type RecFields () :: [Assoc Symbol Type] Source #

toRecord :: IsRecord a => a -> Record (RecFields a) Source #

Convert a value into a Record.

fromRecord :: IsRecord a => Record (RecFields a) -> a Source #

Convert a Record to a value.

record :: (IsRecord a, Functor f, Profunctor p) => Optic' p f a (Record (RecFields a)) Source #

record :: IsRecord a => Iso' a (Record (RecFields a))

deriveIsRecord :: Name -> DecsQ Source #

Create an IsRecord instance for a normal record declaration.