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

Data.Record.QQ.CodeGen.HSE

Description

Additional utilities for working with haskell-src-exts

Synopsis

Language extensions

extensionFromTH :: Extension -> Extension Source #

Translate TH extension into HSE extension

Useful in combination with extsEnabled.

processRecordPuns :: forall l. Data l => Pat l -> Pat l Source #

Naming

fromHseName :: Name -> Name flavour 'Dynamic Source #

HSE generated names are always dynamically bound

resolveHseName :: (Quasi m, LookupName ns') => (String -> String) -> Name ns 'Dynamic -> m (Maybe (Name ns' 'Global)) Source #

Resolve HSE generated name

As mentioned in fromHseName, HSE generated names are always dynamically bound, and we therefore need to do a "renaming pass": we need to resolve the name. However, the exact name we want to lookup might not be the name as it appears in the QQ place; for if the user writes MkR, the name we actually want to look up might be, say, LR__MkR.

resolveKnownHseName :: (Quasi m, LookupName ns') => (String -> String) -> Name ns 'Dynamic -> m (Name ns' 'Global) Source #

Variation on resolveHseName that fails if the name is not known