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

Data.Record.Internal.TH.Util

Description

Utility functions for working with TH

Synopsis

Folding

appsT :: Q Type -> [Q Type] -> Q Type Source #

Repeated application

appsT f [x1, .., xN] constructs something like

f x1 .. xN

arrT :: [Q Type] -> Q Type -> Q Type Source #

Repeated application of (->)

arrT [x1, .., xN] y constructs something like

x1 -> .. -> xN -> y

Constructing lists (variations on listE)

vectorE :: (a -> Q Exp) -> [a] -> Q Exp Source #

Simplified construction

simpleFn :: Name 'VarName flavour -> Q Type -> Q Exp -> Q [Dec] Source #

Construct simple function

simpleFn n typ body constructs something like

f :: typ
f = body

simplePatSynType :: [TyVarBndr] -> [Q Type] -> Q Type -> Q PatSynType Source #

Construct simple pattern synonym type

simplePatSynType xs [t1, .., tn] s constructs something like

pattern foo :: forall xs. t1 -> .. -> tn -> s

Dealing with type variables

Bang

Extensions

requiresExtensions :: Quasi m => [Extension] -> m () Source #

Check that the specified extensions are enabled

To improve user experience, we report all missing extensions at once (rather than giving an error for the first missing one).