posix-api: posix bindings
This library provides a very thin wrapper around POSIX APIs. It can be
compiled on any operating system that implements the standard as specified
in IEEE Std 1003.1
faithfully. It has similar goals as the
unix package, but its design
differs in several areas:
Addrare used pervasively. There is no use of
Stringin this library.
Functions do not throw errors. This library uses `IO (Either Errno a)` in places where
unixwould use `IO a`.
The numeric types from
System.Posix.Typesare used in the type signatures of functions so that a haskell function's type signature matches its underlying POSIX equivalent exactly.
Flags are newtypes over
CInt(or whatever integral type matches the posix specification) rather than enumerations. The data constructors are exported, making the types extensible for operating system that have additional flags.
About a dozen other packages offers wrappers for some subset of the POSIX specification are strewn across hackage. They include `regex-posix`, `posix-paths`, `posix-timer`, `posix-socket`, `posix-filelock`, `posix-acl`, etc. This library differs from all off these in various ways. Here are some of the design guidelines followed here that distinguish this package from some or all of these others:
Scope. Although this library does not include all APIs specified by POSIX, it welcomes as many of them as anyone is willing to implement.
Monomorphization. Effectful functions in this library return their results in
IOrather than using a type that involves
Typeclass avoidance. This library does not introduce new typeclasses. Overloading is eschewed in favor of providing multiple functions with distinct names.
Minimality. Functions wrapping the POSIX APIs do little more than wrap the underlying functions. The major deviation here is that, when applicable, the wrappers allocate buffers are the underlying functions fill. This eschews C's characteristic buffer-passing in favor of the Haskell convention of allocating internally and returning. A more minor deviation is that for safe FFI calls, this library will perform additional work to ensure that only pinned byte arrays are handed over.
network, this sockets API in this library does not integrate
sockets with GHC's event manager. This is geared
toward an audience that understands how to use
threadWaitWrite with unsafe FFI calls to avoid blocking
[Skip to Readme]
Extra run-time invariant checking
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
- posix-api-0.4.0.0.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
For package maintainers and hackage trustees
|Versions [RSS]||0.1.0.0, 0.2.0.0, 0.2.1.0, 0.3.0.0, 0.3.2.0, 0.3.3.0, 0.3.4.0, 0.3.5.0, 0.4.0.0|
|Dependencies||base (>=4.11.1 && <5), byte-order (>=0.1.2 && <0.2), byteslice (>=0.1.3 && <0.3), primitive (>=0.7 && <0.10), primitive-addr (>=0.1 && <0.2), primitive-offset (>=0.2 && <0.3), primitive-unlifted (>=0.1 && <0.2), run-st (>=0.1.1 && <0.2) [details]|
|Copyright||2018 Andrew Martin|
|Revised||Revision 1 made by andrewthad at 2023-05-04T16:07:16Z|
|Uploaded||by andrewthad at 2022-12-08T19:44:18Z|
|Reverse Dependencies||3 direct, 0 indirect [details]|
|Downloads||3358 total (47 in the last 30 days)|
|Rating||(no votes yet) [estimated by Bayesian average]|
|Status||Docs not available [build log]
All reported builds failed as of 2022-12-08 [all 2 reports]