Safe Haskell | None |
---|---|
Language | Haskell2010 |
Pakej Widget
s
- newtype Widget m l v a b = Widget {
- unWidget :: Wire (Timed NominalDiffTime ()) SomeException (StateT (HashMap l (Access v)) m) a b
- type PakejWidget = Widget IO Text Text (WidgetConf Integer)
- fromWire :: Monad n => (forall e m. Monad m => Wire (Timed NominalDiffTime ()) e m a b) -> Widget n l v a b
- data Access t
- public :: (Eq l, Hashable l, Monad m) => l -> Widget m l v v v
- private :: (Eq l, Hashable l, Monad m) => l -> Widget m l v v v
- aggregate :: (Hashable l, Monad m) => [Widget m l v (WidgetConf n) Text] -> Widget m l v (WidgetConf n) Text
- text :: (Hashable l, MonadIO m, Integral n) => IO Text -> Widget m l v (WidgetConf n) Text
- system :: (Hashable l, MonadIO m, Integral n) => IO (ExitCode, Text, Text) -> Widget m l v (WidgetConf n) Text
- constant :: (Hashable l, MonadIO m, Integral n) => IO b -> Widget m l v (WidgetConf n) b
- widget :: (Hashable l, MonadIO m, Integral n) => a -> (a -> IO a) -> Widget m l v (WidgetConf n) a
- data WidgetConf n
- defaultWidgetConf :: Num n => WidgetConf n
- every :: (Hashable l, Monad m) => n -> Widget m l v (WidgetConf n) (WidgetConf n)
- second :: Num a => a
- minute :: Num a => a
- hour :: Num a => a
- day :: Num a => a
- inbetween :: (Hashable l, Monad m) => Text -> Widget m l v (WidgetConf n) (WidgetConf n)
- data PakejException
- mkFix :: Monoid s => (s -> a -> Either e b) -> Wire s e m a b
- mkFixM :: (Monad m, Monoid s) => (s -> a -> m (Either e b)) -> Wire s e m a b
- mkState :: Monoid t => s -> (t -> (a, s) -> (Either e b, s)) -> Wire t e m a b
- mkStateM :: (Monad m, Monoid t) => s -> (t -> (a, s) -> m (Either e b, s)) -> Wire t e m a b
Documentation
newtype Widget m l v a b Source
Widget is an Automaton that operates over Monad
m
collecting
results in the mapping l -> v
Widget | |
|
type PakejWidget = Widget IO Text Text (WidgetConf Integer) Source
A highly monomorphic Widget
type used by Pakej itself
fromWire :: Monad n => (forall e m. Monad m => Wire (Timed NominalDiffTime ()) e m a b) -> Widget n l v a b Source
Get a widget from an abstract Wire
Store the result
Public results are available everywhere, but the private ones are only available for local queries (meaning queries to the local UNIX socket Pakej's listening)
public :: (Eq l, Hashable l, Monad m) => l -> Widget m l v v v Source
Store the Widget'
s result under the specified label publicly
private :: (Eq l, Hashable l, Monad m) => l -> Widget m l v v v Source
Store the Widget'
s result under the specified label privately
Combine the results
aggregate :: (Hashable l, Monad m) => [Widget m l v (WidgetConf n) Text] -> Widget m l v (WidgetConf n) Text Source
Aggregate all successful Widget's
results
Failed Widget's
results are skipped so they do not clutter the resulting value
Construct
system :: (Hashable l, MonadIO m, Integral n) => IO (ExitCode, Text, Text) -> Widget m l v (WidgetConf n) Text Source
Construct a Widget
from the external command.
constant :: (Hashable l, MonadIO m, Integral n) => IO b -> Widget m l v (WidgetConf n) b Source
Construct a Widget
from the IO action
widget :: (Hashable l, MonadIO m, Integral n) => a -> (a -> IO a) -> Widget m l v (WidgetConf n) a Source
Construct a Widget
from the iterating IO action
Configure
defaultWidgetConf :: Num n => WidgetConf n Source
The default Widget
configuration
every :: (Hashable l, Monad m) => n -> Widget m l v (WidgetConf n) (WidgetConf n) Source
Wait n
seconds between Widget
updates
inbetween :: (Hashable l, Monad m) => Text -> Widget m l v (WidgetConf n) (WidgetConf n) Source
Separate Widget
s values by some Text
Misc
data PakejException Source
Exceptions that can be thrown while updating Widget
s
netwire-4 helpers
mkFixM :: (Monad m, Monoid s) => (s -> a -> m (Either e b)) -> Wire s e m a b Source
A port of netwire-4's mkFixM