So after a few days at working with #c2hs to make bindings to #sundials in #haskell, I'm actually impressed by it.
It's a tool to help with writing bindings to C library. It can generate a lot of the boilerplate associated with this sort of stuff (e.g., generating wrapper types on the Haskell side) and typechecks the FFI imports by analyzing the C types in the library's headers.
It's not perfect, for instance, I still have one weird problem with the types of some function pointers not being imported correctly. But, while I didn't test anything until I had done everything, I haven't had any segfault or unexpected result with the generated bindings, and I find that pretty impressive!
Cuuuuurves
More cuuuuurves
I wanted to explain the code you get in Haskell to write this sort of model, but it's actually quite tricky to explain in a toot^^
Hopefully I'll write a blog post about this when this is more polished
Cuuuuurves