template-haskell-lift-0.1.0.0: The 'Lift' typeclass.
Safe HaskellTrustworthy
LanguageHaskell2010

Language.Haskell.TH.Lift

Synopsis

Documentation

class Lift (t :: TYPE r) where Source #

A Lift instance can have any of its values turned into a Template Haskell expression. This is needed when a value used within a Template Haskell quotation is bound outside the Oxford brackets ([| ... |] or [|| ... ||]) but not at the top level. As an example:

add1 :: Int -> Code Q Int
add1 x = [|| x + 1 ||]

Template Haskell has no way of knowing what value x will take on at splice-time, so it requires the type of x to be an instance of Lift.

A Lift instance must satisfy $(lift x) ≡ x and $$(liftTyped x) ≡ x for all x, where $(...) and $$(...) are Template Haskell splices. It is additionally expected that lift x ≡ unTypeCode (liftTyped x).

Lift instances can be derived automatically by use of the -XDeriveLift GHC language extension:

{-# LANGUAGE DeriveLift #-}
module Foo where

import Language.Haskell.TH.Syntax

data Bar a = Bar1 a (Bar a) | Bar2 String
  deriving Lift

Representation-polymorphic since template-haskell-2.16.0.0.

This is exposed both from the template-haskell-lift and template-haskell packages. Consider importing it from the more stable template-haskell-lift if you don't need the full breadth of the template-haskell interface.

Minimal complete definition

liftTyped

Methods

lift :: Quote m => t -> m Exp Source #

Turn a value into a Template Haskell expression, suitable for use in a splice.

default lift :: forall m. (r ~ LiftedRep, Quote m) => t -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => t -> Code m t Source #

Turn a value into a Template Haskell typed expression, suitable for use in a typed splice.

Since: template-haskell-2.16.0.0

Instances

Instances details
Lift Addr# Source #

Produces an Addr# literal from the NUL-terminated C-string starting at the given memory address.

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Addr# -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Addr# -> Code m Addr# Source #

Lift Double# Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Double# -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Double# -> Code m Double# Source #

Lift Float# Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Float# -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Float# -> Code m Float# Source #

Lift Int# Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Int# -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Int# -> Code m Int# Source #

Lift ByteArray Source # 
Instance details

Defined in Data.Array.Byte

Methods

lift :: Quote m => ByteArray -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => ByteArray -> Code m ByteArray Source #

Lift Void Source #

Since: template-haskell-2.15.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Void -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Void -> Code m Void Source #

Lift ForeignSrcLang Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => ForeignSrcLang -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => ForeignSrcLang -> Code m ForeignSrcLang Source #

Lift Int16 Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Int16 -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Int16 -> Code m Int16 Source #

Lift Int32 Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Int32 -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Int32 -> Code m Int32 Source #

Lift Int64 Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Int64 -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Int64 -> Code m Int64 Source #

Lift Int8 Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Int8 -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Int8 -> Code m Int8 Source #

Lift Extension Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Extension -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Extension -> Code m Extension Source #

Lift AnnLookup Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => AnnLookup -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => AnnLookup -> Code m AnnLookup Source #

Lift AnnTarget Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => AnnTarget -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => AnnTarget -> Code m AnnTarget Source #

Lift Bang Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Bang -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Bang -> Code m Bang Source #

Lift BndrVis Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => BndrVis -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => BndrVis -> Code m BndrVis Source #

Lift Body Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Body -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Body -> Code m Body Source #

Lift Bytes Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Bytes -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Bytes -> Code m Bytes Source #

Lift Callconv Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Callconv -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Callconv -> Code m Callconv Source #

Lift Clause Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Clause -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Clause -> Code m Clause Source #

Lift Con Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Con -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Con -> Code m Con Source #

Lift Dec Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Dec -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Dec -> Code m Dec Source #

Lift DecidedStrictness Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Lift DerivClause Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => DerivClause -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => DerivClause -> Code m DerivClause Source #

Lift DerivStrategy Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => DerivStrategy -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => DerivStrategy -> Code m DerivStrategy Source #

Lift DocLoc Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => DocLoc -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => DocLoc -> Code m DocLoc Source #

Lift Exp Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Exp -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Exp -> Code m Exp Source #

Lift FamilyResultSig Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Lift Fixity Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Fixity -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Fixity -> Code m Fixity Source #

Lift FixityDirection Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Lift Foreign Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Foreign -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Foreign -> Code m Foreign Source #

Lift FunDep Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => FunDep -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => FunDep -> Code m FunDep Source #

Lift Guard Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Guard -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Guard -> Code m Guard Source #

Lift Info Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Info -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Info -> Code m Info Source #

Lift InjectivityAnn Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => InjectivityAnn -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => InjectivityAnn -> Code m InjectivityAnn Source #

Lift Inline Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Inline -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Inline -> Code m Inline Source #

Lift Lit Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Lit -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Lit -> Code m Lit Source #

Lift Loc Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Loc -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Loc -> Code m Loc Source #

Lift Match Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Match -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Match -> Code m Match Source #

Lift ModName Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => ModName -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => ModName -> Code m ModName Source #

Lift Module Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Module -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Module -> Code m Module Source #

Lift Name Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Name -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Name -> Code m Name Source #

Lift NameFlavour Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => NameFlavour -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => NameFlavour -> Code m NameFlavour Source #

Lift NameIs Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => NameIs -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => NameIs -> Code m NameIs Source #

Lift NameSpace Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => NameSpace -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => NameSpace -> Code m NameSpace Source #

Lift NamespaceSpecifier Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Lift OccName Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => OccName -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => OccName -> Code m OccName Source #

Lift Overlap Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Overlap -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Overlap -> Code m Overlap Source #

Lift Pat Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Pat -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Pat -> Code m Pat Source #

Lift PatSynArgs Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => PatSynArgs -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => PatSynArgs -> Code m PatSynArgs Source #

Lift PatSynDir Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => PatSynDir -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => PatSynDir -> Code m PatSynDir Source #

Lift Phases Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Phases -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Phases -> Code m Phases Source #

Lift PkgName Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => PkgName -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => PkgName -> Code m PkgName Source #

Lift Pragma Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Pragma -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Pragma -> Code m Pragma Source #

Lift Range Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Range -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Range -> Code m Range Source #

Lift Role Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Role -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Role -> Code m Role Source #

Lift RuleBndr Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => RuleBndr -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => RuleBndr -> Code m RuleBndr Source #

Lift RuleMatch Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => RuleMatch -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => RuleMatch -> Code m RuleMatch Source #

Lift Safety Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Safety -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Safety -> Code m Safety Source #

Lift SourceStrictness Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Lift SourceUnpackedness Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Lift Specificity Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Specificity -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Specificity -> Code m Specificity Source #

Lift Stmt Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Stmt -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Stmt -> Code m Stmt Source #

Lift TyLit Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => TyLit -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => TyLit -> Code m TyLit Source #

Lift TySynEqn Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => TySynEqn -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => TySynEqn -> Code m TySynEqn Source #

Lift Type Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Type -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Type -> Code m Type Source #

Lift TypeFamilyHead Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => TypeFamilyHead -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => TypeFamilyHead -> Code m TypeFamilyHead Source #

Lift Word16 Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Word16 -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Word16 -> Code m Word16 Source #

Lift Word32 Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Word32 -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Word32 -> Code m Word32 Source #

Lift Word64 Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Word64 -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Word64 -> Code m Word64 Source #

Lift Word8 Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Word8 -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Word8 -> Code m Word8 Source #

Lift Integer Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Integer -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Integer -> Code m Integer Source #

Lift Natural Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Natural -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Natural -> Code m Natural Source #

Lift () Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => () -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => () -> Code m () Source #

Lift Bool Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Bool -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Bool -> Code m Bool Source #

Lift Char Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Char -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Char -> Code m Char Source #

Lift Double Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Double -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Double -> Code m Double Source #

Lift Float Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Float -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Float -> Code m Float Source #

Lift Int Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Int -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Int -> Code m Int Source #

Lift Word Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Word -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Word -> Code m Word Source #

Lift Char# Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Char# -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Char# -> Code m Char# Source #

Lift Word# Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Word# -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Word# -> Code m Word# Source #

Lift (# #) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# #) -> Code m (# #) Source #

Lift a => Lift (NonEmpty a :: Type) Source #

Since: template-haskell-2.15.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => NonEmpty a -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => NonEmpty a -> Code m (NonEmpty a) Source #

Integral a => Lift (Ratio a :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Ratio a -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Ratio a -> Code m (Ratio a) Source #

Lift a => Lift (TyVarBndr a :: Type) Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => TyVarBndr a -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => TyVarBndr a -> Code m (TyVarBndr a) Source #

Lift a => Lift (Maybe a :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Maybe a -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Maybe a -> Code m (Maybe a) Source #

Lift a => Lift ([a] :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => [a] -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => [a] -> Code m [a] Source #

Lift (Fixed a :: Type) Source #

Since: base-4.21.0.0

Instance details

Defined in Data.Fixed

Methods

lift :: Quote m => Fixed a -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Fixed a -> Code m (Fixed a) Source #

(Lift a, Lift b) => Lift (Either a b :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Either a b -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Either a b -> Code m (Either a b) Source #

Lift (TExp a :: Type) Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => TExp a -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => TExp a -> Code m (TExp a) Source #

(Lift a, Lift b) => Lift ((a, b) :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (a, b) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (a, b) -> Code m (a, b) Source #

(Lift a, Lift b, Lift c) => Lift ((a, b, c) :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (a, b, c) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (a, b, c) -> Code m (a, b, c) Source #

(Lift a, Lift b, Lift c, Lift d) => Lift ((a, b, c, d) :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (a, b, c, d) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (a, b, c, d) -> Code m (a, b, c, d) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e) => Lift ((a, b, c, d, e) :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (a, b, c, d, e) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (a, b, c, d, e) -> Code m (a, b, c, d, e) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift ((a, b, c, d, e, f) :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (a, b, c, d, e, f) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (a, b, c, d, e, f) -> Code m (a, b, c, d, e, f) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift ((a, b, c, d, e, f, g) :: Type) Source # 
Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (a, b, c, d, e, f, g) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (a, b, c, d, e, f, g) -> Code m (a, b, c, d, e, f, g) Source #

Lift a => Lift ((# a #) :: TYPE ('TupleRep '[LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a #) -> Code m (# a #) Source #

(Lift a, Lift b) => Lift ((# a | b #) :: TYPE ('SumRep '[LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a | b #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a | b #) -> Code m (# a | b #) Source #

(Lift a, Lift b) => Lift ((# a, b #) :: TYPE ('TupleRep '[LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a, b #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a, b #) -> Code m (# a, b #) Source #

(Lift a, Lift b, Lift c) => Lift ((# a | b | c #) :: TYPE ('SumRep '[LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a | b | c #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a | b | c #) -> Code m (# a | b | c #) Source #

(Lift a, Lift b, Lift c) => Lift ((# a, b, c #) :: TYPE ('TupleRep '[LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a, b, c #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a, b, c #) -> Code m (# a, b, c #) Source #

(Lift a, Lift b, Lift c, Lift d) => Lift ((# a | b | c | d #) :: TYPE ('SumRep '[LiftedRep, LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a | b | c | d #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a | b | c | d #) -> Code m (# a | b | c | d #) Source #

(Lift a, Lift b, Lift c, Lift d) => Lift ((# a, b, c, d #) :: TYPE ('TupleRep '[LiftedRep, LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a, b, c, d #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a, b, c, d #) -> Code m (# a, b, c, d #) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e) => Lift ((# a | b | c | d | e #) :: TYPE ('SumRep '[LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a | b | c | d | e #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a | b | c | d | e #) -> Code m (# a | b | c | d | e #) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e) => Lift ((# a, b, c, d, e #) :: TYPE ('TupleRep '[LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a, b, c, d, e #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a, b, c, d, e #) -> Code m (# a, b, c, d, e #) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift ((# a | b | c | d | e | f #) :: TYPE ('SumRep '[LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a | b | c | d | e | f #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a | b | c | d | e | f #) -> Code m (# a | b | c | d | e | f #) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f) => Lift ((# a, b, c, d, e, f #) :: TYPE ('TupleRep '[LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a, b, c, d, e, f #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a, b, c, d, e, f #) -> Code m (# a, b, c, d, e, f #) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift ((# a | b | c | d | e | f | g #) :: TYPE ('SumRep '[LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a | b | c | d | e | f | g #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a | b | c | d | e | f | g #) -> Code m (# a | b | c | d | e | f | g #) Source #

(Lift a, Lift b, Lift c, Lift d, Lift e, Lift f, Lift g) => Lift ((# a, b, c, d, e, f, g #) :: TYPE ('TupleRep '[LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep, LiftedRep])) Source #

Since: template-haskell-2.16.0.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => (# a, b, c, d, e, f, g #) -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => (# a, b, c, d, e, f, g #) -> Code m (# a, b, c, d, e, f, g #) Source #

data Q a Source #

In short, Q provides the Quasi operations in one neat monad for the user.

The longer story, is that Q wraps an arbitrary Quasi-able monad. The perceptive reader notices that Quasi has only two instances, Q itself and IO, neither of which have concrete implementations.Q plays the trick of dependency inversion, providing an abstract interface for the user which is later concretely fufilled by an concrete Quasi instance, internal to GHC.

Instances

Instances details
Applicative Q Source # 
Instance details

Defined in GHC.Internal.TH.Monad

Methods

pure :: a -> Q a Source #

(<*>) :: Q (a -> b) -> Q a -> Q b Source #

liftA2 :: (a -> b -> c) -> Q a -> Q b -> Q c Source #

(*>) :: Q a -> Q b -> Q b Source #

(<*) :: Q a -> Q b -> Q a Source #

Functor Q Source # 
Instance details

Defined in GHC.Internal.TH.Monad

Methods

fmap :: (a -> b) -> Q a -> Q b Source #

(<$) :: a -> Q b -> Q a Source #

Monad Q Source # 
Instance details

Defined in GHC.Internal.TH.Monad

Methods

(>>=) :: Q a -> (a -> Q b) -> Q b Source #

(>>) :: Q a -> Q b -> Q b Source #

return :: a -> Q a Source #

MonadFail Q Source # 
Instance details

Defined in GHC.Internal.TH.Monad

Methods

fail :: HasCallStack => String -> Q a Source #

MonadFix Q Source #

If the function passed to mfix inspects its argument, the resulting action will throw a FixIOException.

Since: ghc-internal-2.17.0.0

Instance details

Defined in GHC.Internal.TH.Monad

Methods

mfix :: (a -> Q a) -> Q a Source #

MonadIO Q Source # 
Instance details

Defined in GHC.Internal.TH.Monad

Methods

liftIO :: IO a -> Q a Source #

Quasi Q Source # 
Instance details

Defined in GHC.Internal.TH.Monad

Quote Q Source # 
Instance details

Defined in GHC.Internal.TH.Monad

Methods

newName :: String -> Q Name Source #

Monoid a => Monoid (Q a) Source #

Since: ghc-internal-2.17.0.0

Instance details

Defined in GHC.Internal.TH.Monad

Methods

mempty :: Q a Source #

mappend :: Q a -> Q a -> Q a Source #

mconcat :: [Q a] -> Q a Source #

Semigroup a => Semigroup (Q a) Source #

Since: ghc-internal-2.17.0.0

Instance details

Defined in GHC.Internal.TH.Monad

Methods

(<>) :: Q a -> Q a -> Q a Source #

sconcat :: NonEmpty (Q a) -> Q a Source #

stimes :: Integral b => b -> Q a -> Q a Source #

data Code (m :: Type -> Type) (a :: TYPE r) Source #

Represents an expression which has type a, built in monadic context m. Built on top of TExp, typed expressions allow for type-safe splicing via:

  • typed quotes, written as [|| ... ||] where ... is an expression; if that expression has type a, then the quotation has type Quote m => Code m a
  • typed splices inside of typed quotes, written as $$(...) where ... is an arbitrary expression of type Quote m => Code m a

Traditional expression quotes and splices let us construct ill-typed expressions:

>>> fmap ppr $ runQ (unTypeCode [| True == $( [| "foo" |] ) |])
GHC.Internal.Types.True GHC.Internal.Classes.== "foo"
>>> GHC.Internal.Types.True GHC.Internal.Classes.== "foo"
<interactive> error:
    • Couldn't match expected type ‘Bool’ with actual type ‘[Char]’
    • In the second argument of ‘(==)’, namely ‘"foo"’
      In the expression: True == "foo"
      In an equation for ‘it’: it = True == "foo"

With typed expressions, the type error occurs when constructing the Template Haskell expression:

>>> fmap ppr $ runQ (unTypeCode [|| True == $$( [|| "foo" ||] ) ||])
<interactive> error:
    • Couldn't match type ‘[Char]’ with ‘Bool’
      Expected type: Code Q Bool
        Actual type: Code Q [Char]
    • In the Template Haskell quotation [|| "foo" ||]
      In the expression: [|| "foo" ||]
      In the Template Haskell splice $$([|| "foo" ||])

class Monad m => Quote (m :: Type -> Type) Source #

The Quote class implements the minimal interface which is necessary for desugaring quotations.

  • The Monad m superclass is needed to stitch together the different AST fragments.
  • newName is used when desugaring binding structures such as lambdas to generate fresh names.

Therefore the type of an untyped quotation in GHC is `Quote m => m Exp`

For many years the type of a quotation was fixed to be `Q Exp` but by more precisely specifying the minimal interface it enables the Exp to be extracted purely from the quotation without interacting with Q.

Minimal complete definition

newName

Instances

Instances details
Quote Q Source # 
Instance details

Defined in GHC.Internal.TH.Monad

Methods

newName :: String -> Q Name Source #

Quote IO Source # 
Instance details

Defined in GHC.Internal.TH.Monad

Methods

newName :: String -> IO Name Source #

data Exp Source #

A Haskell expression.

Instances

Instances details
Eq Exp Source # 
Instance details

Defined in GHC.Internal.TH.Syntax

Methods

(==) :: Exp -> Exp -> Bool Source #

(/=) :: Exp -> Exp -> Bool Source #

Ord Exp Source # 
Instance details

Defined in GHC.Internal.TH.Syntax

Methods

compare :: Exp -> Exp -> Ordering Source #

(<) :: Exp -> Exp -> Bool Source #

(<=) :: Exp -> Exp -> Bool Source #

(>) :: Exp -> Exp -> Bool Source #

(>=) :: Exp -> Exp -> Bool Source #

max :: Exp -> Exp -> Exp Source #

min :: Exp -> Exp -> Exp Source #

Data Exp Source # 
Instance details

Defined in GHC.Internal.Data.Data

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Exp -> c Exp Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Exp Source #

toConstr :: Exp -> Constr Source #

dataTypeOf :: Exp -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Exp) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Exp) Source #

gmapT :: (forall b. Data b => b -> b) -> Exp -> Exp Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Exp -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Exp -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Exp -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Exp -> m Exp Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Exp -> m Exp Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Exp -> m Exp Source #

Generic Exp Source # 
Instance details

Defined in GHC.Internal.TH.Syntax

Associated Types

type Rep Exp 
Instance details

Defined in GHC.Internal.TH.Syntax

type Rep Exp = D1 ('MetaData "Exp" "GHC.Internal.TH.Syntax" "ghc-internal" 'False) (((((C1 ('MetaCons "VarE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)) :+: C1 ('MetaCons "ConE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name))) :+: (C1 ('MetaCons "LitE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Lit)) :+: C1 ('MetaCons "AppE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)))) :+: ((C1 ('MetaCons "AppTypeE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type)) :+: C1 ('MetaCons "InfixE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Exp)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Exp))))) :+: (C1 ('MetaCons "UInfixE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp))) :+: (C1 ('MetaCons "ParensE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: C1 ('MetaCons "LamE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Pat]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)))))) :+: (((C1 ('MetaCons "LamCaseE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Match])) :+: C1 ('MetaCons "LamCasesE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Clause]))) :+: (C1 ('MetaCons "TupE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Maybe Exp])) :+: (C1 ('MetaCons "UnboxedTupE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Maybe Exp])) :+: C1 ('MetaCons "UnboxedSumE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SumAlt) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SumArity)))))) :+: ((C1 ('MetaCons "CondE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp))) :+: C1 ('MetaCons "MultiIfE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Guard, Exp)]))) :+: (C1 ('MetaCons "LetE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Dec]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: (C1 ('MetaCons "CaseE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Match])) :+: C1 ('MetaCons "DoE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ModName)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]))))))) :+: ((((C1 ('MetaCons "MDoE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ModName)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt])) :+: C1 ('MetaCons "CompE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]))) :+: (C1 ('MetaCons "ArithSeqE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range)) :+: C1 ('MetaCons "ListE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Exp])))) :+: ((C1 ('MetaCons "SigE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type)) :+: C1 ('MetaCons "RecConE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FieldExp]))) :+: (C1 ('MetaCons "RecUpdE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FieldExp])) :+: (C1 ('MetaCons "StaticE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: C1 ('MetaCons "UnboundVarE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)))))) :+: (((C1 ('MetaCons "LabelE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "ImplicitParamVarE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) :+: (C1 ('MetaCons "GetFieldE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: (C1 ('MetaCons "ProjectionE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty String))) :+: C1 ('MetaCons "TypedBracketE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp))))) :+: ((C1 ('MetaCons "TypedSpliceE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: C1 ('MetaCons "TypeE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type))) :+: (C1 ('MetaCons "ForallE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TyVarBndr Specificity]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: (C1 ('MetaCons "ForallVisE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TyVarBndr ()]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: C1 ('MetaCons "ConstrainedE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Exp]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp))))))))

Methods

from :: Exp -> Rep Exp x Source #

to :: Rep Exp x -> Exp Source #

Show Exp Source # 
Instance details

Defined in GHC.Internal.TH.Syntax

Lift Exp Source #

Since: template-haskell-2.22.1.0

Instance details

Defined in GHC.Internal.TH.Lift

Methods

lift :: Quote m => Exp -> m Exp Source #

liftTyped :: forall (m :: Type -> Type). Quote m => Exp -> Code m Exp Source #

type Rep Exp Source # 
Instance details

Defined in GHC.Internal.TH.Syntax

type Rep Exp = D1 ('MetaData "Exp" "GHC.Internal.TH.Syntax" "ghc-internal" 'False) (((((C1 ('MetaCons "VarE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)) :+: C1 ('MetaCons "ConE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name))) :+: (C1 ('MetaCons "LitE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Lit)) :+: C1 ('MetaCons "AppE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)))) :+: ((C1 ('MetaCons "AppTypeE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type)) :+: C1 ('MetaCons "InfixE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Exp)) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Exp))))) :+: (C1 ('MetaCons "UInfixE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp))) :+: (C1 ('MetaCons "ParensE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: C1 ('MetaCons "LamE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Pat]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)))))) :+: (((C1 ('MetaCons "LamCaseE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Match])) :+: C1 ('MetaCons "LamCasesE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Clause]))) :+: (C1 ('MetaCons "TupE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Maybe Exp])) :+: (C1 ('MetaCons "UnboxedTupE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Maybe Exp])) :+: C1 ('MetaCons "UnboxedSumE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SumAlt) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SumArity)))))) :+: ((C1 ('MetaCons "CondE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp))) :+: C1 ('MetaCons "MultiIfE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Guard, Exp)]))) :+: (C1 ('MetaCons "LetE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Dec]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: (C1 ('MetaCons "CaseE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Match])) :+: C1 ('MetaCons "DoE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ModName)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]))))))) :+: ((((C1 ('MetaCons "MDoE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ModName)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt])) :+: C1 ('MetaCons "CompE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Stmt]))) :+: (C1 ('MetaCons "ArithSeqE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Range)) :+: C1 ('MetaCons "ListE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Exp])))) :+: ((C1 ('MetaCons "SigE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type)) :+: C1 ('MetaCons "RecConE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FieldExp]))) :+: (C1 ('MetaCons "RecUpdE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [FieldExp])) :+: (C1 ('MetaCons "StaticE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: C1 ('MetaCons "UnboundVarE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name)))))) :+: (((C1 ('MetaCons "LabelE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "ImplicitParamVarE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) :+: (C1 ('MetaCons "GetFieldE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: (C1 ('MetaCons "ProjectionE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (NonEmpty String))) :+: C1 ('MetaCons "TypedBracketE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp))))) :+: ((C1 ('MetaCons "TypedSpliceE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: C1 ('MetaCons "TypeE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Type))) :+: (C1 ('MetaCons "ForallE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TyVarBndr Specificity]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: (C1 ('MetaCons "ForallVisE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [TyVarBndr ()]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp)) :+: C1 ('MetaCons "ConstrainedE" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Exp]) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Exp))))))))

Compatibilty shims

defaultLiftTyped :: forall a (m :: Type -> Type). (Lift a, Quote m) => a -> Code m a Source #

Convert an implementation of lift into one for liftTyped.

liftAddrCompat :: Quote m => ForeignPtr Word8 -> Word -> Word -> m Exp Source #

A compatibility shim for lifting an Addr# value.

liftIntCompat :: Quote m => Integer -> m Exp Source #

A compatibility shim for lifting an Int value without triggering bugs if RebindableSyntax is used in a module.