Portability | non-portable (GHC extensions) |
---|---|
Stability | experimental |
Maintainer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> |
Safe Haskell | None |
This module exports the principal API for inline Objective-C.
- objc_import :: [FilePath] -> Q [Dec]
- objc_interface :: [Definition] -> Q [Dec]
- objc_implementation :: [Name] -> [Definition] -> Q [Dec]
- objc :: [Name] -> Name -> Exp -> Q Exp
- objc_emit :: Q [Dec]
Documentation
objc_import :: [FilePath] -> Q [Dec]Source
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.)
FIXME: need to use TH.addDependentFile on each of the imported ObjC files & read headers
objc_interface :: [Definition] -> Q [Dec]Source
Inline Objective-C top-level definitions for a header file ('.h').
objc_implementation :: [Name] -> [Definition] -> Q [Dec]Source
Inline Objective-C top-level definitions for an implementation file ('.m').
The 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.)
objc :: [Name] -> Name -> Exp -> Q ExpSource
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 and whose return value will be marshalled to the Haskell type given by the second argument.