Tutorial by Examples

The Q :: * -> * type constructor defined in Language.Haskell.TH.Syntax is an abstract type representing computations which have access to the compile-time environment of the module in which the computation is run. The Q type also handles variable substituion, called name capture by TH (and discus...
The familiar curry :: ((a,b) -> c) -> a -> b -> c curry = \f a b -> f (a,b) function can be generalized to tuples of arbitrary arity, for example: curry3 :: ((a, b, c) -> d) -> a -> b -> c -> d curry4 :: ((a, b, c, d) -> e) -> a -> b -> c -> d -&gt...
Template Haskell is enabled by the -XTemplateHaskell GHC extension. This extension enables all the syntactic features further detailed in this section. The full details on Template Haskell are given by the user guide. Splices A splice is a new syntactic entity enabled by Template Haskell, writ...

Page 1 of 1