Maintainer | ongy |
---|---|
Stability | testing |
Portability | Linux |
Safe Haskell | None |
Language | Haskell2010 |
Example that limits MPD song title to 20 characters
import Data.Text as T
modifyMPD :: [MonkyOut] -> [MonkyOut]
modifyMPD orig@(MonkyPlain xs:ys) =
if T.length xs > 20
then MonkyPlain (T.take 17 xs append
"..."):ys
else orig
evtPack $ getModifyHandle modifyMPD $ getMPDHandle "127.0.0.1" "6600"
- data ModifyHandle a
- getModifyHandle :: ([MonkyOut] -> [MonkyOut]) -> IO a -> IO (ModifyHandle a)
- data IOModifyHandle a
- getIOModifyHandle :: ([MonkyOut] -> IO [MonkyOut]) -> IO a -> IO (IOModifyHandle a)
- changeImage :: Char -> MonkyOut -> MonkyOut
Documentation
data ModifyHandle a Source #
Handle for duing pure modification of module output
EvtModule a => EvtModule (ModifyHandle a) Source # | |
PollModule a => PollModule (ModifyHandle a) Source # | |
getModifyHandle :: ([MonkyOut] -> [MonkyOut]) -> IO a -> IO (ModifyHandle a) Source #
Get a handle to purely modify another modules output
data IOModifyHandle a Source #
Handle for modifying output in IO monad
EvtModule a => EvtModule (IOModifyHandle a) Source # | |
PollModule a => PollModule (IOModifyHandle a) Source # | |
getIOModifyHandle :: ([MonkyOut] -> IO [MonkyOut]) -> IO a -> IO (IOModifyHandle a) Source #
Get a handle that can modify another handles output in the IO monad