large-records-0.1.0.0: Efficient compilation for large records, linear in the size of the record
Safe HaskellNone
LanguageHaskell2010

Data.Record.Generic.SOP

Description

Interop with generics-sop generics

Synopsis

Documentation

Translate between SOP representation and large-records representation

newtype Field (f :: Type -> Type) (field :: (Symbol, Type)) where Source #

Constructors

Field :: f (FieldType field) -> Field f field 

Instances

Instances details
Eq (f x) => Eq (Field f '(nm, x)) Source # 
Instance details

Defined in Data.Record.Generic.SOP

Methods

(==) :: Field f '(nm, x) -> Field f '(nm, x) -> Bool #

(/=) :: Field f '(nm, x) -> Field f '(nm, x) -> Bool #

Show (f x) => Show (Field f '(nm, x)) Source # 
Instance details

Defined in Data.Record.Generic.SOP

Methods

showsPrec :: Int -> Field f '(nm, x) -> ShowS #

show :: Field f '(nm, x) -> String #

showList :: [Field f '(nm, x)] -> ShowS #

toSOP :: SListI (MetadataOf a) => Rep f a -> Maybe (NP (Field f) (MetadataOf a)) Source #

Translate constraints

toDictAll :: forall f a c. (Generic a, Constraints a (Compose c f), All IsField (MetadataOf a), forall nm x. c (f x) => c (Field f '(nm, x))) => Proxy f -> Proxy a -> Proxy c -> Dict (All (Compose c (Field f))) (MetadataOf a) Source #

Translate constraints

When using toSOP, if you start with something of type

Rep f a

you end up with something of type

NP (Field f) (MetadataOf a)

When doing so, toDictAll can translate

Constraints a (Compose c f)

(which is useful over the original representation) to

All (Compose c (Field f)) (MetadataOf a)

which is useful for the translated representation.

Additional SOP functions

glowerBound :: (Generic a, All LowerBound xs, Code a ~ '[xs]) => a Source #