extensible-0.7: 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.

Minimal complete definition

Nothing

Associated Types

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

Methods

recordFromList :: HList (Field Identity) (RecFields a) -> a Source #

recordToList :: a -> HList (Field Identity) (RecFields a) Source #

recordFromList :: (Generic a, GIsRecord (Rep a) '[], GRecFields (Rep a) '[] ~ RecFields a) => HList (Field Identity) (RecFields a) -> a Source #

recordToList :: (Generic a, GIsRecord (Rep a) '[], GRecFields (Rep a) '[] ~ RecFields a) => a -> HList (Field Identity) (RecFields a) Source #

Instances
IsRecord () Source # 
Instance details

Defined in Data.Extensible.Record

Associated Types

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

Methods

recordFromList :: HList (Field Identity) (RecFields ()) -> () Source #

recordToList :: () -> HList (Field Identity) (RecFields ()) 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))