My attempt at Haskell USB

Maurí­cio briqueabraque at yahoo.com
Thu Jun 4 13:03:01 EDT 2009


A few months ago, I declared here that I intended to get USB
working in Haskell. After a lot of thinking on what could be
a realistic goal, this is where I've got:

http://hackage.haskell.org/packages/archive/bindings-libusb/0.0.3/doc/html/Bindings-Libusb.html

I know this is probably a disapointment for most of you, but
please try to understand the concept at the base package:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/bindings-common-0.1.3

What I'm doing is to group under these bindings-* packages
a Haskell link to well established libraries. But Bindings.*
modules are not supposed to be Haskell code, but C (or other
languages, in the future?) code in Haskell.

You may ask what good is this. Well, suppose you want to write
a nice module, using GADTs, Template Haskell and STM, using
functionality from libusb or other libraries bindings-* have
links to. Just learn to use Foreign.Ptr, Foreign.Marshable and
friends. Forget about the details of FFI, it's already done,
and it's really time consuming and boring, believe me, I've
been there.

Are there other libraries you would like to have low-level
bindings for? Just tell. I've organized and standardized things
in a way that it is really easy to add other libraries really
fast. Here is another example:

http://hackage.haskell.org/packages/archive/bindings-sqlite3/0.0.2/doc/html/Bindings-Sqlite3.html

Hope you can use it somehow. This is my attempt in doing
something that may be usefull to others after all the great
and friendly support I've had from this community in the last
month and years. Thanks for you all, gtk2hs guys specially.

Best,
Maurício



More information about the Libraries mailing list