hs-bindgen-runtime
Safe HaskellSafe-Inferred
LanguageGHC2021

HsBindgen.Runtime.Block

Description

Bare-bones support for blocks

TODO: Ideally we would at least support Block_copy and Block_release. This would be easy to do, but would mean that hs-bindgen-runtime would then depend on the runtime (libblocksruntime).

This module is intended to be imported qualified.

import HsBindgen.Runtime.Prelude
import HsBindgen.Runtime.Block qualified as Block
Synopsis

Documentation

newtype Block t Source #

Block

See https://clang.llvm.org/docs/BlockLanguageSpec.html

The type index is the type of the bloc, for example:

typedef int(^VarCounter)(int increment);

corresponds to

newtype VarCounter = VarCounter (Block (CInt -> IO CInt))

Constructors

Block (Ptr ())