úÎĒĢ™ß$      !"##[2013..2016] Manuel M T ChakravartyBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None$%&'()*+,-./0123456789:;<=>?@$03456789:;<=>?@$%&'()*+,-./0123456789:;<=>?@[2013] Manuel M T ChakravartyBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)NoneABCDEFABEFABCDEF#[2013..2016] Manuel M T ChakravartyBSD3-Manuel M T Chakravarty <chak@justtesting.org> experimentalnon-portable (GHC extensions)None%&9; G_Hints imply marshalling strategies, which include source and destination types for marshalling.Annotating entities with hints.The alternatives are to provide an explicit marshalling hint with '(:>)', or to leave the marshalling implicitly defined by the name's type. SWe provide additional syntax where the hint is to the left of the annotated entity. !Annotation for irrelevant resultsH!Pretty print an annotated entity.IBDetermine the Haskell type implied for the given annotated entity.JTDetermine the foreign type *directly* implied for the given annotated entity if any.KXDetermine the name of the function to create a new foreign pointer for this type if any.LRemove the annotation.GMNOP HIJKLQRGOMNP HIJKL GMNOP HIJKLQR#[2014..2016] Manuel M T ChakravartyBSD3-Manuel M T Chakravarty <chak@justtesting.org> experimentalnon-portable (GHC extensions)None%&9;SHProject the name of the head of a type term if it is a type constructor.TLike S1, but fail if the head is not a type constructor.U@Decompose an n-ary type application into its head and arguments.V;Obtain the data constructor of the newtype in an idiomatic  wrapper of the form <newtype Wrapper <tvs> = Wrapper (ForeignPtr (Wrapper <tvs>))WAUnwraps a newtype wrapper around a foreign pointer and turns the  into a X.Y]Generate code that unwraps the foreign pointer inside the given foreign pointer wrapper type.ZQGiven a type whose head is a newtype wrapper around a foreign pointer of the form <newtype Wrapper <tvs> = Wrapper (ForeignPtr (Wrapper <tvs>))Ireturn the name of the wrapper data constructor and type argument of the  , where all '<tvs>'p have been substituted by the arguments in the type application constituting the input type (might be nullary).STUVWYZSTVWYSTUVWYZ#[2013..2016] Manuel M T ChakravartyBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None M[QConstructs C code to marshal an argument (used to marshal arguments and results).=The argument is the identifier of the value to be marshalled.?The result of the generated expression is the marshalled value.\SConstructs Haskell code to marshal a value (used to marshal arguments and results).GThe first argument is the code referring to the value to be marshalled.VThe second argument is the continuation that gets the marshalled value as an argument.]Turn a retainable Objective-C pointer into a foreign pointer that is released when finalised.ūNB: We need to retain the pointer first as it won't come with a +1 retain count for Haskell land to consume (at best, it will have an autoreleased +1 if it is a function return result).TTurn a non-retainable C pointer into a foreign pointer that is freed when finalised.]9Determine the C type that we map a given Haskell type to.^ļDetermine the C type that we map a given Haskell type constructor to  i.e., we map all Haskell types whose outermost constructor is the given type constructor to the returned C type.xAll types representing boxed values that are not explicitly mapped to a specific C type, are mapped to stable pointers._hGenerate the type-specific marshalling code for Haskell to C land marshalling for a Haskell-C type pair.(The result has the following components:,Haskell type after Haskell-side marshalling.!C type before C-side marshalling.0Generator for the Haskell-side marshalling code.*Generator for the C-side marshalling code.`hGenerate the type-specific marshalling code for Haskell to C land marshalling for a C-Haskell type pair.hThe first argument is a function to turn a pointer into a foreign pointer in the case where an explicit Class or Struct hint was provided.(The result has the following components:,Haskell type after Haskell-side marshalling.!C type before C-side marshalling.0Generator for the Haskell-side marshalling code.*Generator for the C-side marshalling code.[\ ]^ab_c`def [\ ]_`[\ ]^ab_c`def#[2014..2016] Manuel M T ChakravartyBSD3-Manuel M T Chakravarty <chak@justtesting.org> experimentalnon-portable (GHC extensions)None%&9;ČHint indicating to marshal a pointer to a C struct as a foreign pointer, where the argument is the Haskell type representing the C type name. The Haskell type name must coincide with the C type name.NB: This is like ] with the difference that finalisers on foreign pointers created during marshalling use free rather than release.ŨHint indicating to marshal an Objective-C object as a foreign pointer, where the argument is the Haskell type representing the Objective-C class. The Haskell type name must coincide with the Objective-C class name./Class of entities that can be used as TH types. ghijklghijkl#[2013..2016] Manuel M T ChakravartyBSD3-Manuel M T Chakravarty <chak@cse.unsw.edu.au> experimentalnon-portable (GHC extensions)None {Maps a quoted property to a quoted projection and a quoted update function in addition to the type of the projected value.ĶSpecify imported Objective-C files. Needs to be spliced where an import declaration can appear. (Just put it straight after all the import statements in the module.)SNB: This inline splice must appear before any other use of inline code in a module.XFIXME: need to use TH.addDependentFile on each of the imported ObjC files & read headers<Inline Objective-C top-level definitions for a header file ('.h').EInline Objective-C top-level definitions for an implementation file ('.m').ĸdThe top-level Haskell variables given in the first argument will be foreign exported to be accessed from the generated Objective-C code. In C, these Haskell variables will always be represented as functions. (In particular, if the Haskell variable refers to a CAF, it will be a nullary function in C  after all, a thunk may still need to be evaluated.);Map a property to explicit projection and update functions.gMap a property to a field label. This function assumes that the field name is typed and can be reified.cSpecification of a bridge for a Haskell structure that can be queried and updated from Objective-C.ŧThe first argument is the name of the Objective-C class that will be a proxy for the Haskell structure. The second argument the name of the Haskell type of the bridged Haskell structure.·The generated class is immutable. When a property is updated, a new instance is allocated. This closely mirrors the behaviour of the Haskell structure for which the class is a proxy.@The designated initialiser of the generated class is '[-initWith HsName+HsPtr:(HsStablePtr)particleHsPtr]', where  '<HsName>'ē is the type name of the Haskell structure. This initialiser is generated if it is not explicitly provided. The generated method '[-init]' calls the designated initialiser with nil for the stable pointer.WWARNING: This is a very experimental feature and it will SURELY change in the future!!!MFIXME: don't generate the designated initialiser if it is explicitly providedDeprecated: use  or   insteadDeclare a Haskell -UObjective-C marshaller pair to be used in all subsequent marshalling code generation.wOn the Objective-C side, the marshallers must use a wrapped foreign pointer to an Objective-C class (just as those of g hints). The domain and codomain of the two marshallers must be the opposite and both are executing in m. Declare a Haskell -UObjective-C marshaller pair to be used in all subsequent marshalling code generation.nOn the Objective-C side, the marshallers must use a wrapped foreign pointer to an C struct (just as those of g hints). The domain and codomain of the two marshallers must be the opposite and both are executing in m.!Inline Objective-C expression.ĸ!The inline expression will be wrapped in a C function whose arguments are marshalled versions of the Haskell variables given in the first argument. The marshalling of the variables and of the result is determined by the marshalling annotations at the variables and the inline expression."^Emit the Objective-C file and return the foreign declarations. Needs to be the last use of an  'objc...'; function. (Just put it at the end of the Haskell module.)#HForce type checking of all declaration appearing earlier in this module.ĸŽTemplate Haskell performs type checking on declaration groups seperated by toplevel splices. In order for a type declaration to be available to an Objective-C inline directive, the type declaration must be in an earlier declaration group than the Objective-C inline directive. A toplevel Objective-C inline directive always is the start of a new declaration group; hence, it can be considered to be implicitly preceded by an #.nopprefix of the class name class name9name of the Haskell type of the bridged Haskell structure*Haskell variables used in Objective-C codeRObjective-C properties with corresponding Haskell projections and update functionsextra interface declarations!extra implementation declarations q!rstuv"#Ywxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦ  !"#$  #!" nop q!rstuv"#Ž          !!"#$%&'()*+,-./00123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ab cdefghijklmnopqrstuvwxyz{|}~€‚ƒ„ …† …† …‡ …‡ …ˆ …ˆ …‰ …‰ …Š …Š …‹ …‹ …Œ …Œ … … …Ž …Ž … … … … …‘ …‘ …’ …’ …“ …“ …” …” …• …• …– …– …— …— …˜ …˜ …™ …™ …š …š …› …œ … …ž …ž …Ÿ …Ÿ …  …  …Ą …ĄĒ1language-c-inline-0.7.11.0-FD0uaLWgtri8XLDovMLMMlLanguage.C.Inline.ObjCLanguage.C.Inline.StateLanguage.C.Inline.ErrorLanguage.C.Inline.HintLanguage.C.Inline.THLanguage.C.Inline.ObjC.MarshalLanguage.C.Inline.ObjC.Hinttemplate-haskellLanguage.Haskell.TH.SyntaxNamebaseGHC.ForeignPtr ForeignPtrForeign.C.ErrorErrnoForeign.C.StringCString CStringLenCWString CWStringLencastForeignPtr Annotated:>Typed<:voidobjc_release_ptr objc_release objc_retainnewForeignClassPtrnewForeignStructPtrStructClassIsTypePropertyAccess objc_importobjc_interfaceobjc_implementation==>--> objc_recordobjc_marshallerobjc_class_marshallerobjc_struct_marshallerobjc objc_emitobjc_typecheckState foreignTable foreignLabelsheaders marshallers hoistedObjC_h hoistedObjC_m hoistedHSCustomMarshallerstate initialStateinitialiseState readState modifyStatesetForeignTable stashHeaderstashMarshaller stashObjC_h stashObjC_mstashHSextendJumpTablegetForeignTablegetForeignLabels getHeadersgetMarshallerslookupMarshallergetHoistedObjC getHoistedHSreportErrorWithLangreportErrorAndFailreportErrorAndFail'showLangtryWithPlaceholderprettyQCHintannotatedShowQ haskellTypeOf foreignTypeOfnewForeignPtrOfstripAnnotation haskellType foreignTypeshowQnewForeignPtrName$fHintQ $fHintName headTyConNameheadTyConNameOrError splitAppTyforeignWrapperDataconptrOfForeignPtrWrapperGHC.PtrPtrunwrapForeignPtrWrapperdecomposeForeignPtrWrapper CMarshallerHaskellMarshallerhaskellTypeToCTypehaskellTypeNameToCTypegenerateHaskellToCMarshallergenerateCToHaskellMarshallerhaskellToCTypeMap isCPtrTypegenerateHaskellToCMarshaller'generateCToHaskellMarshaller' cIntegralMap cFloatingMaptheType $fHintStruct $fHintClass $fIsTypeName $fIsTypeQ $fIsTypeTypeghc-prim GHC.TypesIO:==>maybeErrorCtypeforExpDobjc_marshaller'haskellWrapperTypewrapperBodyTypegenerateCWrappercParamsgenerateHSCallForeign.C.TypesCCharCSCharCUCharCShortCUShortCIntCUIntCLongCULongCLLongCULLongCFloatCDoubleCPtrdiffCSizeCWchar CSigAtomicCClockCTime CUSeconds CSUSecondsCFileCFposCJmpBufCIntPtrCUIntPtrCIntMaxCUIntMax