My attempt at Haskell USB
Isaac Dupree
ml at isaac.cedarswampstudios.org
Thu Jun 4 14:56:12 EDT 2009
Maurício wrote:
> 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.
seconded: the Haskell FFI is really nice BUT it's a potential for type
mismatches that cause crashes! So, there's an advantage to put them all
in one package that's easier to check, and not worry as much in the
packages that *use* the bindings.
-Isaac
More information about the Libraries
mailing list