Generate Haskell bindings for GObject Introspection capable libraries


Version on this page:0.23.1
LTS Haskell 22.29:0.26.10
Stackage Nightly 2024-07-19:0.26.10
Latest on Hackage:0.26.10

See all snapshots haskell-gi appears in

LGPL-2.1-only licensed by Will Thompson, Iñaki García Etxebarria, Jonas Platte
Maintained by Iñaki García Etxebarria ([email protected])
This version can be pinned in stack with:haskell-gi-0.23.1@sha256:cd32b00d482baf64d8ec23f1181dbf983211aa238d05de8928511f4884b2e7f2,5208

Generate Haskell bindings for GObject Introspection capable libraries. This includes most notably Gtk+, but many other libraries in the GObject ecosystem provide introspection data too.



  • Check whether symbols exist in the dynamic library before trying to generate bindings for them, in order to avoid linker errors.


  • gobjectType now does not require a proxy argument, it needs to be used with TypeApplications instead.

  • Annotated signals are supported: on widget (signal ::: "detail").

  • Safe coercions to parent types supported, with asA.

  • Support for GObject subclassing, and registering custom properties.

  • Use TypeApplications in AttrInfo implementation, and inherited methods implementation.

  • Add an allocating setting operator (:&=).

  • Support for exporting class structs.

  • IsGValue instances for GObjects and boxed objects.


  • Fix generated IsX typeclasses for non-GObject interfaces.


  • Add support for inheriting overloading info.


  • Do not generate bindings for struct/union fields pointing to private/class structs, which we do not bind.


  • Sometimes struct fields marked as not introspectable contain invalid introspection info. We are lenient in these cases with parsing errors, and simply ignore the fields.


  • Add support for callback-valued properties.


  • Try to guess signedness of enums and flags on the C side, fixes #184.


  • Do not add nodes in overrides if a node with the same name already exists, fixes #171.


  • Do not free Ptr Word8 types after performing the call to C, since they only get passed along. Otherwise one could easily double free in functions such as GdkPixbuf.pixbufNewFromData.

  • Fix a leak on optional ScopeTypeAsync callbacks.


  • Improve marshaling of array arguments with no specified size. This improves the generated bindings for various functions, for instance GObject.signalEmitv.

  • Replace the enable-overloading flags with a explicit CPP check of the version of haskell-gi-overloading we are being compiled against, see issue 124 for the rationale.


  • Make the overloading code protected by a CPP conditional, depending on ENABLE_OVERLOADING being defined. See issue 107.

  • Wrap boxed structs/unions as transient ManagedPtrs in callbacks. This is needed to fix a number of issues, including issue 96 and issue 97.


  • Fixes for GHC 8.2.1.


  • gtk-doc parser and haddock generator: while by no means perfect, now the autogenerated bindings come with some reasonable autogenerated documentation.

  • Many bugfixes. A particularly important one is for issue 82, which made compilation of gi-glib fail, for the latest version of gobject-introspection.