Copyright | (c) 2017 Quixoftic LLC |
---|---|
License | BSD3 |
Maintainer | Drew Hess <dhess-src@quixoftic.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Trustworthy |
Language | Haskell2010 |
The actual Linux sysfs
implementation. This implementation will only
function properly on Linux systems with a sysfs
subsystem,
obviously.
- newtype SysfsIOT m a = SysfsIOT {
- runSysfsIOT :: m a
SysfsIOT transformer
An instance of MonadSysfs
which runs MonadSysfs
operations in
IO. This instance must be run on an actual Linux sysfs
GPIO
filesystem and will fail in any other environment.
Interactions with threads
Some parts of this implementation use the Haskell C FFI, and may
block on C I/O operations. (Specifically, pollFile
will block in
the C FFI until its event is triggered.) When using this
implementation with GHC, you should compile your program with the
-threaded
option, so that threads performing these blocking
operations do not block other Haskell threads in the system.
Note that the C FFI bits in this implementation are marked as
interruptible
, so that, on versions of GHC later than 7.8.1,
functions such as throwTo
will work properly
when targeting a Haskell thread that uses this implementation.
(On Haskell implementations other than GHC, the threading implications are unknown; see the implementation's notes on how its threading system interacts with the C FFI.)
SysfsIOT | |
|
MonadTrans SysfsIOT Source # | |
MonadRWS r w s m => MonadRWS r w s (SysfsIOT m) Source # | |
MonadError e m => MonadError e (SysfsIOT m) Source # | |
MonadReader r m => MonadReader r (SysfsIOT m) Source # | |
MonadState s m => MonadState s (SysfsIOT m) Source # | |
MonadWriter w m => MonadWriter w (SysfsIOT m) Source # | |
Monad m => Monad (SysfsIOT m) Source # | |
Functor m => Functor (SysfsIOT m) Source # | |
MonadFix m => MonadFix (SysfsIOT m) Source # | |
Applicative m => Applicative (SysfsIOT m) Source # | |
MonadIO m => MonadIO (SysfsIOT m) Source # | |
Alternative m => Alternative (SysfsIOT m) Source # | |
MonadPlus m => MonadPlus (SysfsIOT m) Source # | |
MonadThrow m => MonadThrow (SysfsIOT m) Source # | |
MonadCatch m => MonadCatch (SysfsIOT m) Source # | |
MonadMask m => MonadMask (SysfsIOT m) Source # | |
MonadCont m => MonadCont (SysfsIOT m) Source # | |
(MonadIO m, MonadThrow m) => MonadSysfs (SysfsIOT m) Source # | |