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

Data.Record.Internal.CodeGen

Description

Code generation shared by TH and QQ

Since these can also be used by QQ, these functions cannot take Options.

Synopsis

Records

recordTypeE :: Record a -> Q Exp Source #

Name of the record as a term-level literal

recordConstrE :: Record a -> Q Exp Source #

Name of the constructor as a term-level literal

recordTypeT :: Qualifier -> Record a -> Q Type Source #

The saturated type of the record (that is, with all type vars applied)

recordToVectorE :: Qualifier -> Record a -> Q Exp Source #

Coerce the record to the underlying Vector Any

recordFromVectorDontForceE :: Qualifier -> Record a -> Q Exp Source #

Construct record from the underlying Vector Any

This doesn't force any elements in the vector, so this can be used if

  • the record has lazy fields, or
  • we know through other means that all values are already forced.

See also recordFromVectorForceE.

recordIndexedAccessorE :: Qualifier -> Record a -> Q Exp Source #

The (unsafe) indexed field accessor

recordIndexedOverwriteE :: Qualifier -> Record a -> Q Exp Source #

The (unsafe) indexed field overwrite

Fields

fieldNameE :: Field a -> Q Exp Source #

Name of the field as a term-level literal

fieldNameT :: Field a -> Q Type Source #

Name of the field as a type-level literal

fieldTypeT :: Field a -> Q Type Source #

Type of the field

fieldIndexE :: Field a -> Q Exp Source #

Index of the field

fieldUntypedAccessorE :: Qualifier -> Record a -> Field a -> Q Exp Source #

The indexed field accessor, applied to this field

fieldUntypedOverwriteE :: Qualifier -> Record a -> Field a -> Q Exp Source #

The indexed field overwrite, applied to this field