{-# LANGUAGE MagicHash #-}{-# LANGUAGE UnboxedTuples #-}{-# LANGUAGE TemplateHaskellQuotes #-}{-# LANGUAGE Trustworthy #-}{-# LANGUAGE UnboxedTuples #-}moduleLanguage.Haskell.TH.Syntax (Quote(..),Exp(..),Match(..),Clause(..),Q(..),Pat(..),Stmt(..),Con(..),Type(..),Dec(..),BangType,VarBangType,FieldExp,FieldPat,Name(..),FunDep(..),Pred,RuleBndr(..),TySynEqn(..),InjectivityAnn(..),Kind,Overlap(..),DerivClause(..),DerivStrategy(..),Code(..),ModName(..),addCorePlugin,addDependentFile,addForeignFile,addForeignFilePath,addForeignSource,addModFinalizer,addTempFile,addTopDecls,badIO,bindCode,bindCode_,cmpEq,compareBytes,counter,defaultFixity,eqBytes,extsEnabled,getDoc,getPackageRoot,getQ,get_cons_names,hoistCode,isExtEnabled,isInstance,joinCode,liftCode,location,lookupName,lookupTypeName,lookupValueName,manyName,maxPrecedence,memcmp,mkNameG,mkNameU,mkOccName,mkPkgName,mk_tup_name,mkName,mkNameG_v,mkNameG_d,mkNameG_tc,mkNameL,mkNameS,unTypeCode,mkModName,unsafeCodeCoerce,mkNameQ,mkNameG_fld,modString,nameBase,nameModule,namePackage,nameSpace,newDeclarationGroup,newNameIO,occString,oneName,pkgString,putDoc,putQ,recover,reify,reifyAnnotations,reifyConStrictness,reifyFixity,reifyInstances,reifyModule,reifyRoles,reifyType,report,reportError,reportWarning,runIO,sequenceQ,runQ,showName,showName',thenCmp,tupleDataName,tupleTypeName,unTypeQ,unboxedSumDataName,unboxedSumTypeName,unboxedTupleDataName,unboxedTupleTypeName,unsafeTExpCoerce,ForeignSrcLang(..),Extension(..),AnnLookup(..),AnnTarget(..),Arity,Bang(..),BndrVis(..),Body(..),Bytes(..),Callconv(..),CharPos,Cxt,DecidedStrictness(..),DocLoc(..),FamilyResultSig(..),Fixity(..),FixityDirection(..),Foreign(..),Guard(..),Info(..),Inline(..),InstanceDec,Lit(..),Loc(..),Module(..),ModuleInfo(..),NameFlavour(..),NameIs(..),NameSpace(..),NamespaceSpecifier(..),OccName(..),ParentName,PatSynArgs(..),PatSynDir(..),PatSynType,Phases(..),PkgName(..),Pragma(..),Quasi(..),Range(..),Role(..),RuleMatch(..),Safety(..),SourceStrictness(..),SourceUnpackedness(..),Specificity(..),Strict,StrictType,SumAlt,SumArity,TExp(..),TyLit(..),TyVarBndr(..),TypeFamilyHead(..),Uniq,Unlifted,VarStrictType,makeRelativeToProject ,liftString,Lift(..),dataToExpQ,dataToPatQ,dataToQa,falseName,justName,leftName,liftData,nonemptyName,nothingName,rightName,trueName,addrToByteArrayName ,addrToByteArray ,)whereimportGHC.Internal.TH.SyntaximportGHC.Internal.TH.LiftimportSystem.FilePath importData.Array.ByteimportGHC.ExtsimportGHC.ST-- This module completely re-exports 'GHC.Boot.TH.Syntax',-- and exports additionally functions that depend on filepath.-- | The input is a filepath, which if relative is offset by the package root.makeRelativeToProject ::FilePath->QFilePathmakeRelativeToProject :: FilePath -> Q FilePath
makeRelativeToProject FilePath
fp |FilePath -> Bool
isRelative FilePath
fp =doroot <-Q FilePath
getPackageRootreturn(root </> fp )makeRelativeToProject FilePath
fp =FilePath -> Q FilePath
forall a. a -> Q a
forall (m :: * -> *) a. Monad m => a -> m a
returnFilePath
fp -- The following two defintions are copied from 'Data.Byte.Array'-- in order to preserve the old export list of 'TH.Syntax'.-- They will soon be removed as part of #24782.addrToByteArrayName ::NameaddrToByteArrayName :: Name
addrToByteArrayName ='addrToByteArrayaddrToByteArray ::Int->Addr#->ByteArrayaddrToByteArray :: Int -> Addr# -> ByteArray
addrToByteArray (I#Int#
len )Addr#
addr =(forall s. ST s ByteArray) -> ByteArray
forall a. (forall s. ST s a) -> a
runST((forall s. ST s ByteArray) -> ByteArray)
-> (forall s. ST s ByteArray) -> ByteArray
forall a b. (a -> b) -> a -> b
$STRep s ByteArray -> ST s ByteArray
forall s a. STRep s a -> ST s a
ST(STRep s ByteArray -> ST s ByteArray)
-> STRep s ByteArray -> ST s ByteArray
forall a b. (a -> b) -> a -> b
$\State# s
s ->caseInt# -> State# s -> (# State# s, MutableByteArray# s #)
forall d. Int# -> State# d -> (# State# d, MutableByteArray# d #)
newByteArray#Int#
len State# s
s of(#State# s
s' ,MutableByteArray# s
mb #)->caseAddr#
-> MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
forall d.
Addr#
-> MutableByteArray# d -> Int# -> Int# -> State# d -> State# d
copyAddrToByteArray#Addr#
addr MutableByteArray# s
mb Int#
0#Int#
len State# s
s' ofState# s
s'' ->caseMutableByteArray# s -> State# s -> (# State# s, ByteArray# #)
forall d.
MutableByteArray# d -> State# d -> (# State# d, ByteArray# #)
unsafeFreezeByteArray#MutableByteArray# s
mb State# s
s'' of(#State# s
s''' ,ByteArray#
ret #)->(#State# s
s''' ,ByteArray# -> ByteArray
ByteArrayByteArray#
ret #)

AltStyle によって変換されたページ (->オリジナル) /