Portability | Linux |
---|---|
Stability | testing |
Maintainer | ongy |
Safe Haskell | None |
This module provides utility functions used in monky modules
- loopFd :: h -> Fd -> ([MonkyOut] -> IO ()) -> (h -> IO [MonkyOut]) -> IO ()
- convertUnit :: Int -> Text -> Text -> Text -> Text -> Text
- convertUnitB :: Integral a => a -> Text -> Text
- convertUnitSI :: Integral a => a -> Text -> Text
Documentation
:: h | Some kind of module handle |
-> Fd | The FD to block on |
-> ([MonkyOut] -> IO ()) | The update consume function |
-> (h -> IO [MonkyOut]) | The function to generate the output |
-> IO () | This will loop for you |
Utility Function for eventing modules
convertUnit :: Int -> Text -> Text -> Text -> Text -> TextSource
Convert a number into a fixed length strings
convertUnitB :: Integral a => a -> Text -> TextSource
Convert a number into a reasonable scale for binary units
convertUnitSI :: Integral a => a -> Text -> TextSource
Convert a number into a reasonable scale for SI units