diff --git a/Bindings/Libgit2/Attr.hsc b/Bindings/Libgit2/Attr.hsc
--- a/Bindings/Libgit2/Attr.hsc
+++ b/Bindings/Libgit2/Attr.hsc
@@ -13,6 +13,7 @@
 
 #ccall git_attr_get , Ptr (CString) -> Ptr <git_repository> -> CUInt -> CString -> CString -> IO (CInt)
 #ccall git_attr_get_many , Ptr (CString) -> Ptr <git_repository> -> CUInt -> CString -> CSize -> Ptr (CString) -> IO (CInt)
-#ccall git_attr_foreach , Ptr <git_repository> -> CUInt -> CString -> FunPtr (CString -> CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
+#callback git_attr_foreach_callback , CString -> CString -> Ptr () -> IO CInt
+#ccall git_attr_foreach , Ptr <git_repository> -> CUInt -> CString -> <git_attr_foreach_callback> -> Ptr () -> IO (CInt)
 #ccall git_attr_cache_flush , Ptr <git_repository> -> IO ()
 #ccall git_attr_add_macro , Ptr <git_repository> -> CString -> CString -> IO (CInt)
diff --git a/Bindings/Libgit2/Config.hsc b/Bindings/Libgit2/Config.hsc
--- a/Bindings/Libgit2/Config.hsc
+++ b/Bindings/Libgit2/Config.hsc
@@ -29,16 +29,26 @@
                     void * data);
     void (* free)(struct git_config_file *);
 }; -}
+#callback git_config_open_callback , Ptr <git_config_file> -> IO CInt
+#callback git_config_get_callback , Ptr <git_config_file> -> CString -> Ptr (CString) -> IO CInt
+#callback git_config_get_multivar_inner_callback , CString -> Ptr () -> IO CInt
+#callback git_config_get_multivar_callback , Ptr <git_config_file> -> CString -> CString -> <git_config_get_multivar_inner_callback> -> Ptr () -> IO CInt
+#callback git_config_set_callback , Ptr <git_config_file> -> CString -> CString -> IO CInt
+#callback git_config_set_multivar_callback , Ptr <git_config_file> -> CString -> CString -> CString -> IO CInt
+#callback git_config_del_callback , Ptr <git_config_file> -> CString -> IO CInt
+#callback git_config_foreach_inner_callback , CString -> CString -> Ptr () -> IO CInt
+#callback git_config_foreach_callback , Ptr <git_config_file> -> <git_config_foreach_inner_callback> -> Ptr () -> IO CInt
+#callback git_config_free_callback , Ptr <git_config_file> -> IO ()
 #starttype git_config_file
 #field cfg , Ptr <git_config>
-#field open , FunPtr (Ptr <git_config_file> -> CInt)
-#field get , FunPtr (Ptr <git_config_file> -> CString -> Ptr (CString) -> CInt)
-#field get_multivar , FunPtr (Ptr <git_config_file> -> CString -> CString -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> CInt)
-#field set , FunPtr (Ptr <git_config_file> -> CString -> CString -> CInt)
-#field set_multivar , FunPtr (Ptr <git_config_file> -> CString -> CString -> CString -> CInt)
-#field del , FunPtr (Ptr <git_config_file> -> CString -> CInt)
-#field foreach , FunPtr (Ptr <git_config_file> -> FunPtr (CString -> CString -> Ptr () -> CInt) -> Ptr () -> CInt)
-#field free , FunPtr (Ptr <git_config_file>)
+#field open , <git_config_open_callback>
+#field get , <git_config_get_callback>
+#field get_multivar , <git_config_get_multivar_callback>
+#field set , <git_config_set_callback>
+#field set_multivar , <git_config_set_multivar_callback>
+#field del , <git_config_del_callback>
+#field foreach , <git_config_foreach_callback>
+#field free , <git_config_free_callback>
 #stoptype
 {- typedef enum {
             GIT_CVAR_FALSE = 0,
@@ -72,12 +82,12 @@
 #ccall git_config_get_int64 , Ptr CLong -> Ptr <git_config> -> CString -> IO (CInt)
 #ccall git_config_get_bool , Ptr CInt -> Ptr <git_config> -> CString -> IO (CInt)
 #ccall git_config_get_string , Ptr (CString) -> Ptr <git_config> -> CString -> IO (CInt)
-#ccall git_config_get_multivar , Ptr <git_config> -> CString -> CString -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
+#ccall git_config_get_multivar , Ptr <git_config> -> CString -> CString -> <git_config_get_multivar_inner_callback> -> Ptr () -> IO (CInt)
 #ccall git_config_set_int32 , Ptr <git_config> -> CString -> CInt -> IO (CInt)
 #ccall git_config_set_int64 , Ptr <git_config> -> CString -> CLong -> IO (CInt)
 #ccall git_config_set_bool , Ptr <git_config> -> CString -> CInt -> IO (CInt)
 #ccall git_config_set_string , Ptr <git_config> -> CString -> CString -> IO (CInt)
 #ccall git_config_set_multivar , Ptr <git_config> -> CString -> CString -> CString -> IO (CInt)
 #ccall git_config_delete , Ptr <git_config> -> CString -> IO (CInt)
-#ccall git_config_foreach , Ptr <git_config> -> FunPtr (CString -> CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
+#ccall git_config_foreach , Ptr <git_config> -> <git_config_foreach_inner_callback> -> Ptr () -> IO (CInt)
 #ccall git_config_get_mapped , Ptr CInt -> Ptr <git_config> -> CString -> Ptr <git_cvar_map> -> CSize -> IO (CInt)
diff --git a/Bindings/Libgit2/Notes.hsc b/Bindings/Libgit2/Notes.hsc
--- a/Bindings/Libgit2/Notes.hsc
+++ b/Bindings/Libgit2/Notes.hsc
@@ -19,4 +19,5 @@
 #field blob_oid , <git_oid>
 #field annotated_object_oid , <git_oid>
 #stoptype
-#ccall git_note_foreach , Ptr <git_repository> -> CString -> FunPtr (Ptr <git_note_data> -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
+#callback git_note_foreach_callback , Ptr <git_note_data> -> Ptr () -> IO CInt
+#ccall git_note_foreach , Ptr <git_repository> -> CString -> <git_note_foreach_callback> -> Ptr () -> IO (CInt)
diff --git a/Bindings/Libgit2/OdbBackend.hsc b/Bindings/Libgit2/OdbBackend.hsc
--- a/Bindings/Libgit2/OdbBackend.hsc
+++ b/Bindings/Libgit2/OdbBackend.hsc
@@ -39,16 +39,24 @@
     int (* exists)(struct git_odb_backend *, const git_oid *);
     void (* free)(struct git_odb_backend *);
 }; -}
+#callback git_odb_backend_read_callback , Ptr (Ptr ()) -> Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> IO CInt
+#callback git_odb_backend_read_prefix_callback , Ptr <git_oid> -> Ptr (Ptr ()) -> Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CUInt -> IO CInt
+#callback git_odb_backend_read_header_callback , Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> IO CInt
+#callback git_odb_backend_write_callback , Ptr <git_oid> -> Ptr <git_odb_backend> -> Ptr () -> CSize -> <git_otype> -> IO CInt
+#callback git_odb_backend_writestream_callback , Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb_backend> -> CSize -> <git_otype> -> IO CInt
+#callback git_odb_backend_readstream_callback , Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb_backend> -> Ptr <git_oid> -> IO CInt
+#callback git_odb_backend_exists_callback , Ptr <git_odb_backend> -> Ptr <git_oid> -> IO CInt
+#callback git_odb_backend_free_callback , Ptr <git_odb_backend> -> IO ()
 #starttype git_odb_backend
 #field odb , Ptr <git_odb>
-#field read , FunPtr (Ptr (Ptr ()) -> Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)
-#field read_prefix , FunPtr (Ptr <git_oid> -> Ptr (Ptr ()) -> Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CUInt -> CInt)
-#field read_header , FunPtr (Ptr CSize -> Ptr <git_otype> -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)
-#field write , FunPtr (Ptr <git_oid> -> Ptr <git_odb_backend> -> Ptr () -> CSize -> <git_otype> -> CInt)
-#field writestream , FunPtr (Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb_backend> -> CSize -> <git_otype> -> CInt)
-#field readstream , FunPtr (Ptr (Ptr <git_odb_stream>) -> Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)
-#field exists , FunPtr (Ptr <git_odb_backend> -> Ptr <git_oid> -> CInt)
-#field free , FunPtr (Ptr <git_odb_backend>)
+#field read , <git_odb_backend_read_callback>
+#field read_prefix , <git_odb_backend_read_prefix_callback>
+#field read_header , <git_odb_backend_read_header_callback>
+#field write , <git_odb_backend_write_callback>
+#field writestream , <git_odb_backend_writestream_callback>
+#field readstream , <git_odb_backend_readstream_callback>
+#field exists , <git_odb_backend_exists_callback>
+#field free , <git_odb_backend_free_callback>
 #stoptype
 {- enum {
     GIT_STREAM_RDONLY = 1 << 1,
@@ -71,13 +79,17 @@
                            struct git_odb_stream * stream);
     void (* free)(struct git_odb_stream * stream);
 }; -}
+#callback git_odb_stream_read_callback , Ptr <git_odb_stream> -> CString -> CSize -> IO CInt
+#callback git_odb_stream_write_callback , Ptr <git_odb_stream> -> CString -> CSize -> IO CInt
+#callback git_odb_stream_finalize_write_callback , Ptr <git_oid> -> Ptr <git_odb_stream> -> IO CInt
+#callback git_odb_stream_free_callback , Ptr <git_odb_stream> -> IO ()
 #starttype git_odb_stream
 #field backend , Ptr <git_odb_backend>
 #field mode , CInt
-#field read , FunPtr (Ptr <git_odb_stream> -> CString -> CSize -> CInt)
-#field write , FunPtr (Ptr <git_odb_stream> -> CString -> CSize -> CInt)
-#field finalize_write , FunPtr (Ptr <git_oid> -> Ptr <git_odb_stream> -> CInt)
-#field free , FunPtr (Ptr <git_odb_stream>)
+#field read , <git_odb_stream_read_callback>
+#field write , <git_odb_stream_write_callback>
+#field finalize_write , <git_odb_stream_finalize_write_callback>
+#field free , <git_odb_stream_free_callback>
 #stoptype
 #ccall git_odb_backend_pack , Ptr (Ptr <git_odb_backend>) -> CString -> IO (CInt)
 #ccall git_odb_backend_loose , Ptr (Ptr <git_odb_backend>) -> CString -> CInt -> CInt -> IO (CInt)
diff --git a/Bindings/Libgit2/Refs.hsc b/Bindings/Libgit2/Refs.hsc
--- a/Bindings/Libgit2/Refs.hsc
+++ b/Bindings/Libgit2/Refs.hsc
@@ -22,7 +22,8 @@
 #ccall git_reference_delete , Ptr <git_reference> -> IO (CInt)
 #ccall git_reference_packall , Ptr <git_repository> -> IO (CInt)
 #ccall git_reference_list , Ptr <git_strarray> -> Ptr <git_repository> -> CUInt -> IO (CInt)
-#ccall git_reference_foreach , Ptr <git_repository> -> CUInt -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
+#callback git_reference_foreach_callback , CString -> Ptr () -> IO CInt
+#ccall git_reference_foreach , Ptr <git_repository> -> CUInt -> <git_reference_foreach_callback> -> Ptr () -> IO (CInt)
 #ccall git_reference_is_packed , Ptr <git_reference> -> IO (CInt)
 #ccall git_reference_reload , Ptr <git_reference> -> IO (CInt)
 #ccall git_reference_free , Ptr <git_reference> -> IO ()
diff --git a/Bindings/Libgit2/Remote.hsc b/Bindings/Libgit2/Remote.hsc
--- a/Bindings/Libgit2/Remote.hsc
+++ b/Bindings/Libgit2/Remote.hsc
@@ -25,7 +25,8 @@
 #ccall git_remote_connected , Ptr <git_remote> -> IO (CInt)
 #ccall git_remote_disconnect , Ptr <git_remote> -> IO ()
 #ccall git_remote_free , Ptr <git_remote> -> IO ()
-#ccall git_remote_update_tips , Ptr <git_remote> -> FunPtr (CString -> Ptr <git_oid> -> Ptr <git_oid> -> CInt) -> IO (CInt)
+#callback git_remote_update_tips_callback , CString -> Ptr <git_oid> -> Ptr <git_oid> -> IO CInt
+#ccall git_remote_update_tips , Ptr <git_remote> -> <git_remote_update_tips_callback> -> IO (CInt)
 #ccall git_remote_valid_url , CString -> IO (CInt)
 #ccall git_remote_supported_url , CString -> IO (CInt)
 #ccall git_remote_list , Ptr <git_strarray> -> Ptr <git_repository> -> IO (CInt)
diff --git a/Bindings/Libgit2/Status.hsc b/Bindings/Libgit2/Status.hsc
--- a/Bindings/Libgit2/Status.hsc
+++ b/Bindings/Libgit2/Status.hsc
@@ -23,7 +23,8 @@
 #num GIT_STATUS_WT_MODIFIED
 #num GIT_STATUS_WT_DELETED
 #num GIT_STATUS_IGNORED
-#ccall git_status_foreach , Ptr <git_repository> -> FunPtr (CString -> CUInt -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
+#callback git_status_foreach_callback , CString -> CUInt -> Ptr () -> IO CInt
+#ccall git_status_foreach , Ptr <git_repository> -> <git_status_foreach_callback> -> Ptr () -> IO (CInt)
 {- typedef enum {
             GIT_STATUS_SHOW_INDEX_AND_WORKDIR = 0,
             GIT_STATUS_SHOW_INDEX_ONLY = 1,
@@ -55,6 +56,7 @@
 #field flags , CUInt
 #field pathspec , <git_strarray>
 #stoptype
-#ccall git_status_foreach_ext , Ptr <git_repository> -> Ptr <git_status_options> -> FunPtr (CString -> CUInt -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
+#callback git_status_foreach_ext_callback , CString -> CUInt -> Ptr () -> IO CInt
+#ccall git_status_foreach_ext , Ptr <git_repository> -> Ptr <git_status_options> -> <git_status_foreach_ext_callback> -> Ptr () -> IO (CInt)
 #ccall git_status_file , Ptr CUInt -> Ptr <git_repository> -> CString -> IO (CInt)
 #ccall git_status_should_ignore , Ptr CInt -> Ptr <git_repository> -> CString -> IO (CInt)
diff --git a/Bindings/Libgit2/Submodule.hsc b/Bindings/Libgit2/Submodule.hsc
--- a/Bindings/Libgit2/Submodule.hsc
+++ b/Bindings/Libgit2/Submodule.hsc
@@ -46,5 +46,6 @@
 #field fetch_recurse , CInt
 #field refcount , CInt
 #stoptype
-#ccall git_submodule_foreach , Ptr <git_repository> -> FunPtr (CString -> Ptr () -> CInt) -> Ptr () -> IO (CInt)
+#callback git_submodule_foreach_callback , CString -> Ptr () -> IO CInt
+#ccall git_submodule_foreach , Ptr <git_repository> -> <git_submodule_foreach_callback> -> Ptr () -> IO (CInt)
 #ccall git_submodule_lookup , Ptr (Ptr <git_submodule>) -> Ptr <git_repository> -> CString -> IO (CInt)
diff --git a/Bindings/Libgit2/Tree.hsc b/Bindings/Libgit2/Tree.hsc
--- a/Bindings/Libgit2/Tree.hsc
+++ b/Bindings/Libgit2/Tree.hsc
@@ -27,7 +27,8 @@
 #ccall git_treebuilder_get , Ptr <git_treebuilder> -> CString -> IO (Ptr <git_tree_entry>)
 #ccall git_treebuilder_insert , Ptr (Ptr <git_tree_entry>) -> Ptr <git_treebuilder> -> CString -> Ptr <git_oid> -> CUInt -> IO (CInt)
 #ccall git_treebuilder_remove , Ptr <git_treebuilder> -> CString -> IO (CInt)
-#ccall git_treebuilder_filter , Ptr <git_treebuilder> -> FunPtr (Ptr <git_tree_entry> -> Ptr () -> CInt) -> Ptr () -> IO ()
+#callback git_treebuilder_filter_callback , Ptr <git_tree_entry> -> Ptr () -> IO CInt
+#ccall git_treebuilder_filter , Ptr <git_treebuilder> -> <git_treebuilder_filter_callback> -> Ptr () -> IO ()
 #ccall git_treebuilder_write , Ptr <git_oid> -> Ptr <git_repository> -> Ptr <git_treebuilder> -> IO (CInt)
 #ccall git_tree_get_subtree , Ptr (Ptr <git_tree>) -> Ptr <git_tree> -> CString -> IO (CInt)
 {- typedef int (* git_treewalk_cb)(const char * root,
diff --git a/hlibgit2.cabal b/hlibgit2.cabal
--- a/hlibgit2.cabal
+++ b/hlibgit2.cabal
@@ -1,5 +1,5 @@
 Name:                hlibgit2
-Version:             0.17.0.1
+Version:             0.17.0.2
 Synopsis:            Low-level bindings to libgit2.
 Description:         Bindings to libgit2 v0.17.0
 License-file:        LICENSE
