rtorrent-rpc-0.2.2.0: A library for communicating with RTorrent over its XML-RPC interface.

Copyright(c) Kai Lindholm, 2014
LicenseMIT
Maintainermegantti@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Network.RTorrent.Action.Internals

Description

 

Synopsis

Documentation

data Action i a Source

A type for actions that can act on different things like torrents and files.

a is the return type.

Constructors

Action [(String, [Param])] (forall m. (Monad m, Applicative m) => Value -> m a) i 

Instances

Functor (Action i) 
XmlRpcType i => Command (Action i a) 
type Ret (Action i a) = a 

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.

newtype ActionB i a Source

Wrapper to get monoid and applicative instances.

Constructors

ActionB 

Fields

runActionB :: i -> Action i a
 

Instances

data AllAction i a Source

Constructors

AllAction i String (i -> Action i a) 

Instances

Command (AllAction i a) 
type Ret (AllAction i a) = [a] 

allToMulti :: AllAction i a -> j -> Action j [a] Source