The select package

[ Tags: bsd3, library, system ] [ Propose Tags ]

While tinkering on a project, I frequently found myself having to make FFI calls to select(2). This package is an attempt reduce the boilerplate I needed to do that. While at it, I took the opportunity to have what select returns put in a TMVar.

The package has three parts:

just wraps select.
and Control.Concurrent.MVarIO put the return value of IO actions into a TMVar or an MVar, respectively.
defines functions that give you the return value of whatever finishes first of an IO action and an STM operation.
and System.Posix.IO.Select.MVar do the above for the special case select.

NOTE: I feel I'm occupying prime namespace realestate with a package name like select. I'll happily let myself be chased away if anybody else wants to use this package name. Let me know.

NOTE 2: The vector dependency comes from me not spending time figuring out how to pass lists of data to C without first turning them into vectors. It'll probably disappear soon.

CAVEAT: I'm not an experienced Haskeller (as you can tell from note 2), and this is my first foray into FFI in general. Use with caution.


Versions 0.1, 0.2, 0.2.1, 0.3, 0.4,
Dependencies base (==4.*), stm, vector [details]
License BSD3
Copyright 2012 Gard Spreemann
Author Gard Spreemann
Maintainer Gard Spreemann <>
Category System
Home page
Uploaded Thu Jun 14 18:01:20 UTC 2012 by GardSpreemann
Distributions NixOS:
Downloads 1656 total (9 in the last 30 days)
Rating 0.0 (0 ratings) [clear rating]
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]
Hackage Matrix CI




Maintainer's Corner

For package maintainers and hackage trustees