Copyright | (c) Kai Lindholm, 2014 |
---|---|
License | MIT |
Maintainer | megantti@gmail.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
- data Action i a = Action [(String, [Param])] (forall m. (Monad m, Applicative m) => Value -> m a) i
- simpleAction :: XmlRpcType a => String -> [Param] -> i -> Action i a
- pureAction :: a -> i -> Action i a
- sequenceActions :: Traversable f => f (i -> Action i a) -> i -> Action i (f a)
- (<+>) :: (i -> Action i a) -> (i -> Action i b) -> i -> Action i (a :*: b)
- data Param
- newtype ActionB i a = ActionB {
- runActionB :: i -> Action i a
- data AllAction i a = AllAction i String (i -> Action i a)
- allToMulti :: AllAction i a -> j -> Action j [a]
Documentation
A type for actions that can act on different things like torrents and files.
a
is the return type.
simpleAction :: XmlRpcType a => String -> [Param] -> i -> Action i a Source
A simple action that can be used when constructing new ones.
Watch out for using Bool
as a
since using it with this function will probably result in an error,
since RTorrent actually returns 0 or 1 instead of a bool.
One workaround is to get an Int
and use Bool
's Enum
instance.
pureAction :: a -> i -> Action i a Source
An action that does nothing but return the value.
sequenceActions :: Traversable f => f (i -> Action i a) -> i -> Action i (f a) Source
Sequence multiple actions, for example with f = []
.
(<+>) :: (i -> Action i a) -> (i -> Action i b) -> i -> Action i (a :*: b) infixr 6 Source
Combine two actions to get a new one.
Parameters for actions.
Wrapper to get monoid and applicative instances.
ActionB | |
|
allToMulti :: AllAction i a -> j -> Action j [a] Source