usb-safe: Wrapper around the usb package adding extra type-safety

[ bsd3, library, monadic-regions, system ] [ Propose Tags ]

The usb library provides a standard Haskell abstracting layer over bindings-libusb providing: abstract types instead of Ptrs, automatic marshalling and unmarshalling, automatic garbage collection, exceptions instead of integer return codes, etc..

While all that is very nice there are still some things that you can do wrong. For example doing I/O with a closed device or reading from or writing to an endpoint which doesn't belong to the claimed interface. Or reading from an Out endpoint or writing to an In endpoint.

usb-safe provides the following guarantees:

The primary technique used in usb-safe is called "Lightweight monadic regions" which was invented by Oleg Kiselyov and Chung-chieh Shan. See:

Versions [faq] 0.1, 0.2, 0.3, 0.4, 0.4.1, 0.5, 0.5.1,, 0.6, 0.7, 0.8, 0.9, 0.10, 0.11,,, 0.12, 0.13, 0.14
Dependencies base (>=4 && <4.2), bytestring (==0.9.*), MonadCatchIO-transformers (==0.0.2.*), monads-fd (==0.0.*), transformers (>=0.1.4 && <0.2), unicode-symbols (==0.1.*), usb (==0.3.*) [details]
License BSD-3-Clause
Copyright 2009 Bas van Dijk
Author Bas van Dijk
Maintainer Bas van Dijk <>
Category System
Source repo head: darcs get
Uploaded by BasVanDijk at Wed Dec 9 22:53:04 UTC 2009
Distributions NixOS:0.14
Downloads 8799 total (415 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user
Build status unknown [no reports yet]




Maintainer's Corner

For package maintainers and hackage trustees