h&UKa      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  Safe-Inferred inline-c$( [t| CDouble ->  CDouble |] , generates a foreign import wrapper of type (CDouble ->  CDouble) ->  ( (CDouble ->  CDouble)) And invokes it.inline-c$( 'foo), if foo :: CDouble ->  CDouble#, splices in an expression of type  ( (CDouble ->  CDouble)).inline-c$( [t| CDouble ->  CDouble |]), generates a foreign import dynamic of type  (CDouble ->  CDouble) -> (CDouble ->  CDouble) And invokes it. Safe-Inferred"/689:- Finline-cAll the parsing is done using the type classes provided by the parsers package. You can use the parsing routines with any of the parsers that implement the classes, such as parsec or trifecta.We parametrize the parsing by the type of the variable identifiers, i. We do so because we use this parser to implement anti-quoters referring to Haskell variables, and thus we need to parse Haskell identifiers in certain positions.Ginline-cA type for C identifiers.Linline-cFunction used to determine whether an identifier is a type name.Minline-cParses an identifier, *without consuming whitespace afterwards*.Pinline-c&A collection of named types (typedefs)Sinline-cRuns a F using parsec.Tinline-c Useful for quick testing. Uses "quickCParser" as source name, and throws an  if parsing fails.Uinline-cLike T , but uses R ( ) as I.inline-cSame as =, but does not check that the identifier is not a type name.inline-cThis parser parses a G and nothing else -- it does not consume trailing spaces and the like.Sinline-c Source name.inline-cString to parse.inline-cParser. Anything with type forall m. CParser i m => m a is a valid argument.Tinline-cString to parse.inline-cParser. Anything with type forall m. CParser i m => m a is a valid argument.Uinline-cString to parse.inline-cParser. Anything with type forall m. CParser i m => m a is a valid argument.  !"#$%&'()*6+,-./012345789:;<=>?@ABDECFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghPIJKLMNOGHQRFSTU]ABDECY;<=>?@Z*6+,-./012345789:[&'()^$%_ !"#`cabd fe ghWXV\ Safe-Inferred"%&/689:;6$%&'();<=>?@FGHIPQRSTUGHQ;<=>?@&'()$%PFIRSTU Safe-Inferred/6inline-c(A possibly qualified Haskell identifier.inline-cSee  https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2.inline-cSee  https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2.inline-c Mangles an  to produce a valid G$ which still sort of resembles the . Safe-Inferred")*/01(/inline-c1Type class used to implement the anti-quoters in .inline-c An alias for .inline-cA  stores various information needed to produce the files with the C code derived from the inline C snippets.s can be composed with their  instance, where  is right-biased -- in  x y y will take precedence over x.inline-c+Needed to convert C types to Haskell types.inline-c+Needed to parse and process antiquotations.inline-cThis function is used to post-process the functions generated from the C snippets. Currently just used to specify C linkage when generating C++ code.inline-cTH.LangC by defaultinline-cExistential wrapper around .inline-cAn identifier for a .inline-cParses the body of the antiquotation, returning a hint for the name to assign to the variable that will replace the anti-quotation, the type of said variable, and some arbitrary data which will then be fed to .The  has Void as an identifier type to make sure that no names appear in it.inline-c(Takes the requested purity, the current ), and the type and the body returned by .Returns the Haskell type for the parameter, and the Haskell expression that will be passed in as the parameter.If the the type returned is ty, the  must have type forall a. (ty -> IO a) -> IO a?. This allows to do resource handling when preparing C values.Care must be taken regarding . Specifically, the generated IO computation must be idempotent to guarantee its safety when used in pure code. We cannot prevent the IO computation from being inlined, hence potentially duplicated. If non-idempotent marshallers are required (e.g. if an update to some global state is needed), it is best to throw an error when  is . (for example "you cannot use context X with pure'"), which will show up at compile time.inline-cA data type to indicate whether the user requested pure or IO function from Haskellinline-cA mapping from s to Haskell types. Needed both to parse C types, and to convert them to Haskell types.inline-c7Context useful to work with vanilla C. Used by default.3: converts C basic types to their counterparts in Foreign.C.Types.No .inline-cGiven a , it uses its  to convert arbitrary C types.inline-cThis  adds support for  ForeignPtr0 arguments. It adds a unique marshaller called fptr-ptr. For example, $fptr-ptr:(int *x)5 extracts the bare C pointer out of foreign pointer x.inline-cThis  includes a 1 that removes the need for explicitely creating  s, named "fun" along with one which allocates new memory which must be manually freed named  "fun-alloc".%For example, we can capture function f of type CInt -> CInt -> IO CInt in C code using $fun:(int (*f)(int, int)).When used in a pure embedding, the Haskell function will have to be pure too. Continuing the example above we'll have CInt -> CInt -> IO CInt.Does not include the , since most of the time it's going to be included as part of larger contexts.IMPORTANT: When using the fun anti quoter, one must be aware that the function pointer which is automatically generated is freed when the code contained in the block containing the anti quoter exits. Thus, if you need the function pointer to be longer-lived, you must allocate it and free it manually using 6. We provide utilities to easily allocate them (see  ).IMPORTANT: When using the  fun-alloc anti quoter, one must free the allocated function pointer. The GHC runtime provides a function to do this, hs_free_fun_ptr available in the   header.inline-cThis  includes two 1s that allow to easily use Haskell vectors in C.Specifically, the vec-len and vec-ptr: will get the length and the pointer underlying mutable ( ) and immutable () storable vectors.Note that if you use  to manipulate immutable vectors you must make sure that the vector is not modified in the C code.To use vec-len, simply write  $vec-len:x, where x is something of type   a or  a , for some a . To use vec-ptr4 you need to specify the type of the pointer, e.g. $vec-len:(int *x) will work if x has type   .inline-c$ serves exactly the same purpose as , but only for . vec-ptr becomes bs-ptr, and vec-len becomes bs-len9. You don't need to specify the type of the pointer in bs-ptr, it will always be char*. Moreover, bs-cstr works as bs-ptr6 but it provides a null-terminated copy of the given . Safe-Inferred"%&/67inline-cData to parse for the funPtr quasi-quoter.inline-cData type representing a list of C definitions with a typed and named entry function./We use it as a basis to inline and call C code.inline-cSafety of the foreign call.inline-c8The haskell source location used for the #line directiveinline-cType of the foreign call.inline-c/Name of the function to call in the code below.inline-c The C code.inline-cIf , the type will be wrapped in 4, and the call will be static (e.g. prefixed by &).inline-cMake sure that moduleStatesVar- and the respective C file are up to date.inline-cGets the current ;. Also makes sure that the current module is initialised.inline-c Sets the  for the current module. This function, if called, must be called before any of the other TH functions in this module. Fails if that's not the case.inline-cSimply appends some string to the module's C file. Use with care.inline-c/Inlines a piece of code inline. The resulting & will have the type specified in the .In practice, this function outputs the C code to the module's C file, and then inserts a foreign call of type  calling the provided .Example: c_add :: Int -> Int -> Int c_add = $(do here <- TH.location inlineCode $ Code TH.Unsafe -- Call safety (Just here) [t| Int -> Int -> Int |] -- Call type "francescos_add" -- Call name -- C Code "int francescos_add(int x, int y) { int z = x + y; return z; }") inline-cSame as  inlineCItems, but with a single expression. c_cos :: Double -> Double c_cos = $(do here <- TH.location inlineExp TH.Unsafe here [t| Double -> Double |] (quickCParser_ "double" parseType) [("x", quickCParser_ "double" parseType)] "cos(x)") inline-cSame as , but accepts a string containing a list of C statements instead instead than a full-blown . A function containing the provided statement will be automatically generated. c_cos :: Double -> Double c_cos = $(do here <- TH.location inlineItems TH.Unsafe False Nothing here [t| Double -> Double |] (quickCParser_ "double" parseType) [("x", quickCParser_ "double" parseType)] "return cos(x);") inline-cDefine macros that can be used in the nested Template Haskell expression. Macros can be used as @MACRO_NAME(input) in inline-c quotes, and will transform their input with the given function. They can be useful for passing in types when defining Haskell instances for C++ template types.inline-cGiven a C type name, return the Haskell type in Template Haskell. The first parameter controls whether function pointers should be mapped as pure or IO functions.inline-cThe ) to use if we initialise the module. If ,  will be used.inline-cSafety of the foreign callinline-cThe location to reportinline-cType of the foreign callinline-cReturn type of the C exprinline-cParameters of the C exprinline-cThe C expressioninline-cSafety of the foreign callinline-c$Whether to return as a FunPtr or notinline-c'Optional postfix for the generated nameinline-cThe location to reportinline-cType of the foreign callinline-cReturn type of the C exprinline-cParameters of the C exprinline-c The C itemsinline-c>Returns the return type, the captured variables, and the body.inline-c The parserinline-c-Function building an Haskell expression, see ! for guidance on the other args.inline-c(Returns the type and the body separately## Safe-Inferred;inline-cC expressions.inline-c Variant of 9, for use with expressions known to have no side effects.BEWARE: Use this function with caution, only when you know what you are doing. If an expression does in fact have side-effects, then indiscriminate use of  may endanger referential transparency, and in principle even type safety. Also note that the function may run more than once and that it may run in parallel with itself, given that & is used to call the provided C code  +https://github.com/fpco/inline-c/issues/1156to ensure good performance using the threaded runtime*. Please refer to the documentation for  for more details.inline-c C code blocks (i.e. statements). Safe-Inferred>inline-cC expressions.inline-c Variant of 9, for use with expressions known to have no side effects.BEWARE: Use this function with caution, only when you know what you are doing. If an expression does in fact have side-effects, then indiscriminate use of  may endanger referential transparency, and in principle even type safety. Also note that the function may run more than once and that it may run in parallel with itself, given that & is used to call the provided C code  +https://github.com/fpco/inline-c/issues/1156to ensure good performance using the threaded runtime*. Please refer to the documentation for  for more details.inline-c C code blocks (i.e. statements). Safe-Inferred"%&)*J inline-cType class with methods useful to allocate and peek multiple pointers at once: withPtrs_ :: (Storable a, Storable b) => ((Ptr a, Ptr b) -> IO ()) -> IO (a, b) withPtrs_ :: (Storable a, Storable b, Storable c) => ((Ptr a, Ptr b, Ptr c) -> IO ()) -> IO (a, b, c) ... inline-cC expressions.inline-c Variant of 9, for use with expressions known to have no side effects.BEWARE: Use this function with caution, only when you know what you are doing. If an expression does in fact have side-effects, then indiscriminate use of  may endanger referential transparency, and in principle even type safety. Also note that the function might be called multiple times, given that  is used to call the provided C code. Please refer to the documentation for  for more details.  +https://github.com/fpco/inline-c/issues/115unsafeDupablePerformIO is used to ensure good performance using the threaded runtime.inline-c C code blocks (i.e. statements).inline-c Easily get a FunPtr: let fp :: FunPtr (Ptr CInt -> IO ()) = [C.funPtr| void poke42(int *ptr) { *ptr = 42; } |] =Especially useful to generate finalizers that require C code.+Most importantly, this allows you to write  invocations conveniently: do let c_finalizer_funPtr = [C.funPtr| void myfree(char * ptr) { free(ptr); } |] fp <- newForeignPtr c_finalizer_funPtr objPtr Using where possible  is superior to resorting to its delayed-by-a-thread alternative  from Foreign.Concurrent which takes an IO ()4 Haskell finaliser action: With the non-concurrent  newForeignPtr; you can guarantee that the finaliser will actually be runwhen a GC is executed under memory pressure, because it can point directly to a C function that doesn't have to run any Haskell code (which is problematic when you're out of memory)when the program terminates ('s finaliser will likely NOT be called if your main thread exits, making your program e.g. not Valgrind-clean if your finaliser is free or C++'s delete). makes the normal  newForeignPtr. as convenient as its concurrent counterpart.inline-cEmits a CPP include directive for C code associated with the current module. To avoid having to escape quotes, the function itself adds them when appropriate, so that %include "foo.h" ==> #include "foo.h" but #include "" ==> #include inline-cEmits an arbitrary C string to the C code associated with the current module. Use with care.inline-cLike %, but also peeks the contents of the 9 and returns them once the provided action has finished.inline-c Sets the  for the current module. This function, if called, must be called before any of the other TH functions in this module. Fails if that's not the case.   !!"#$$%&'()*+,-.*/00123456789:;<=>?@ABCDEFGHIJKLMNOPJ953QRSTTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~!!9+,9FDEGHIv~ 'inline-c-0.9.1.8-2TWv5Sfd5Lo9eGXfo5WZk0Language.C.InlineLanguage.C.Types.ParseLanguage.C.Types#Language.C.Inline.HaskellIdentifierLanguage.C.Inline.ContextLanguage.C.Inline.InternalLanguage.C.Inline.UnsafeLanguage.C.Inline.InterruptibleLanguage.C.Inline.FunPtrmkFunPtrHsFFIhVIOVectorSystem.IO.UnsafeunsafeDupablePerformIOunsafePerformIOForeign.ForeignPtr newForeignPtrForeign.ConcurrentmkFunPtrFromName peekFunPtrDirectAbstractDeclaratorArrayOrProtoHereArrayOrProtoThereAbstractDeclaratorParensAbstractDeclaratorabstractDeclaratorPointersabstractDeclaratorDirectDeclaratorOrAbstractDeclarator IsDeclaratorIsAbstractDeclaratorParameterDeclarationparameterDeclarationSpecifiersparameterDeclarationDeclaratorPointer ArrayType VariablySizedUnsizedSizedByIntegerSizedByIdentifier ArrayOrProtoArrayProtoDirectDeclaratorDeclaratorRootDeclaratorParens DeclaratordeclaratorPointersdeclaratorDirectFunctionSpecifierINLINE TypeQualifierCONSTRESTRICTVOLATILE TypeSpecifierVOIDBOOLCHARSHORTINTLONGFLOATDOUBLESIGNEDUNSIGNEDStructEnumTypeNameTemplate TemplateConstTemplatePointerStorageClassSpecifierTYPEDEFEXTERNSTATICAUTOREGISTERDeclarationSpecifierCParser CIdentifier unCIdentifierCParserContext cpcIdentName cpcTypeNames cpcParseIdentcpcIdentToString cpcEnableCpp TypeNamescIdentifierFromStringcCParserContext runCParser quickCParser quickCParser_cReservedWords cIdentStart cIdentLetterdeclaration_specifiersstorage_class_specifiertype_specifier isTypeNameidentifier_no_lextype_qualifierfunction_specifier declaratorarray_or_proto array_typedirect_declaratorpointerparameter_listparameter_declarationabstract_declaratordirect_abstract_declarator$fPrettyCIdentifier$fIsStringCIdentifier$fPrettyStorageClassSpecifier$fPrettyTypeSpecifier$fPrettyTypeQualifier$fPrettyFunctionSpecifier$fPrettyDeclarationSpecifier$fPrettyArrayType$fPrettyPointer $fPrettyDirectAbstractDeclarator$fPrettyAbstractDeclarator$fPrettyParameterDeclaration$fPrettyArrayOrProto$fPrettyDirectDeclarator$fPrettyDeclarator$fEqDirectAbstractDeclarator$fShowDirectAbstractDeclarator!$fFunctorDirectAbstractDeclarator"$fFoldableDirectAbstractDeclarator%$fTraversableDirectAbstractDeclarator$fEqAbstractDeclarator$fShowAbstractDeclarator$fFunctorAbstractDeclarator$fFoldableAbstractDeclarator$fTraversableAbstractDeclarator$fEqArrayOrProto$fShowArrayOrProto$fFunctorArrayOrProto$fFoldableArrayOrProto$fTraversableArrayOrProto$fEqParameterDeclaration$fShowParameterDeclaration$fFunctorParameterDeclaration$fFoldableParameterDeclaration!$fTraversableParameterDeclaration"$fEqDeclaratorOrAbstractDeclarator$$fShowDeclaratorOrAbstractDeclarator'$fFunctorDeclaratorOrAbstractDeclarator($fFoldableDeclaratorOrAbstractDeclarator+$fTraversableDeclaratorOrAbstractDeclarator$fEqDeclarator$fShowDeclarator$fFunctorDeclarator$fFoldableDeclarator$fTraversableDeclarator$fEqDirectDeclarator$fShowDirectDeclarator$fFunctorDirectDeclarator$fFoldableDirectDeclarator$fTraversableDirectDeclarator $fEqPointer $fShowPointer $fEqArrayType$fShowArrayType$fFunctorArrayType$fFoldableArrayType$fTraversableArrayType$fEqDeclarationSpecifier$fShowDeclarationSpecifier$fEqFunctionSpecifier$fShowFunctionSpecifier$fEqTypeQualifier$fShowTypeQualifier$fEqTypeSpecifier$fShowTypeSpecifier$fEqStorageClassSpecifier$fShowStorageClassSpecifier$fEqCIdentifier$fOrdCIdentifier$fShowCIdentifier$fHashableCIdentifier UntangleErrMultipleDataTypes NoDataTypesIllegalSpecifiersparameterDeclarationIdparameterDeclarationTypeSignSignedUnsignedTypePtr SpecifiersstorageClassSpecifierstypeQualifiersfunctionSpecifiersVoidBoolCharShortIntLongLLongFloatDoubleLDoubleuntangleParameterDeclarationtangleParameterDeclarationdescribeParameterDeclaration describeTypeparseParameterDeclarationparseParameterListparseIdentifierparseEnableCpp parseType$fMonoidSpecifiers$fSemigroupSpecifiers $fPrettyType$fPrettyUntangleErr$fShowUntangleErr$fEqUntangleErr $fShowType$fEqType $fFunctorType$fFoldableType$fTraversableType$fOrdTypeSpecifier $fShowSign$fEqSign $fOrdSign$fShowSpecifiers$fEqSpecifiersHaskellIdentifierunHaskellIdentifierhaskellIdentifierFromStringhaskellCParserContexthaskellReservedWordsparseHaskellIdentifiermangleHaskellIdentifier$fPrettyHaskellIdentifier$fIsStringHaskellIdentifier$fEqHaskellIdentifier$fOrdHaskellIdentifier$fShowHaskellIdentifier$fHashableHaskellIdentifierVecCtx VecCtxScalar vecCtxLengthvecCtxUnsafeWithCArrayContext ctxTypesTablectxAntiQuoters ctxOutputctxForeignSrcLang ctxEnableCpp AntiQuotersSomeAntiQuoter AntiQuoterId AntiQuoteraqParser aqMarshallerPurityPureIO TypesTablebaseCtx convertTypetypeNamesFromTypesTablefptrCtxfunCtxvecCtxbsCtx$fMonoidContext$fSemigroupContext$fVecCtxMVector$fVecCtxVector $fEqPurity $fShowPurity SubstitutionsunSubstitutions ParseTypedC ptcReturnType ptcParametersptcBody ParameterTypePlain AntiQuoteSomeEqCodecodeCallSafetycodeLoccodeType codeFunNamecodeDefs codeFunPtr getContext setContext emitVerbatim inlineCode inlineExp inlineItems runParserInQtoSomeEq fromSomeEq substitutegetHaskellType parseTypedC genericQuote splitTypedC funPtrQuote $fShowSomeEq $fEqSomeEq$fEqFunPtrDecl$fShowFunPtrDecl$fShowParameterType$fEqParameterTypeexppureblockWithPtrs WithPtrsPtrswithPtrs withPtrs_funPtrincludeverbatimwithPtrwithPtr_context$fWithPtrs(,,,,,,)$fWithPtrs(,,,,,)$fWithPtrs(,,,,)$fWithPtrs(,,,)$fWithPtrs(,,) $fWithPtrs(,)ghc-prim GHC.TypesbaseGHC.PtrFunPtruniqueFfiImportNameGHC.ErrerrorGHC.BaseconstFalsecidentifier_rawcidentifier_no_lexhaskellIdentStyleMonoidmappendtemplate-haskellLanguage.Haskell.TH.SyntaxExp Foreign.PtrfreeHaskellFunPtr&vector-0.13.0.0-JKrBPPZBIK2JBM2KZEUb7ZData.Vector.StorableVectorForeign.C.TypesCIntbytestring-0.11.3.1Data.ByteString.Internal ByteString FunPtrDeclTrueinitialiseModuleState GHC.MaybeNothing quoteCodeForeign.Marshal.AllocallocaCWcharCUShort CUSecondsCULongCULLongCUIntPtrCUIntMaxCUIntCUCharCTimeCSize CSigAtomicCShort CSUSecondsCSCharCPtrdiffCLongCLLongCJmpBufCIntPtrCIntMaxCFposCFloatCFileCDoubleCClockCCharCBool