| Copyright | (c) Kai Lindholm, 2014 |
|---|---|
| License | MIT |
| Maintainer | megantti@gmail.com |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Network.RTorrent.Command.Internals
Description
- data a :*: b = (:*:) !a !b
- class Command a where
- type Ret a
- commandCall :: a -> RTMethodCall
- commandValue :: (Applicative m, Monad m) => a -> Value -> m (Ret a)
- levels :: a -> Int
- data AnyCommand where
- AnyCommand :: Command a => a -> AnyCommand
- newtype RTMethodCall = RTMethodCall Value
- runRTMethodCall :: RTMethodCall -> Value
- mkRTMethodCall :: String -> [Value] -> RTMethodCall
- parseSingle :: (Monad m, XmlRpcType a) => Value -> m a
- getArray :: Monad m => Value -> m [Value]
- getArray' :: Value -> [Value]
- single :: Monad m => Value -> m Value
- decodeUtf8 :: String -> String
Documentation
A strict 2-tuple for easy combining of commands.
Constructors
| (:*:) !a !b infixr 6 |
A typeclass for commands that can be send to RTorrent.
Minimal complete definition
Methods
commandCall :: a -> RTMethodCall Source
Construct a request.
commandValue :: (Applicative m, Monad m) => a -> Value -> m (Ret a) Source
Parse the resulting value.
data AnyCommand where Source
Existential wrapper for any command.
Commands wrapped in AnyCommand won't parse their results.
AnyCommand can be used when you want to call multiple commands
but don't care about their return values.
Constructors
| AnyCommand :: Command a => a -> AnyCommand |
Instances
| Command AnyCommand | |
| type Ret AnyCommand = Value |
newtype RTMethodCall Source
A newtype wrapper for method calls.
You shouldn't directly use the constructor if you don't know what you are doing.
Constructors
| RTMethodCall Value |
Instances
Arguments
| :: String | The name of the method (i.e. get_up_rate) |
| -> [Value] | List of parameters |
| -> RTMethodCall |
Make a command that should be used when defining commandCall.
parseSingle :: (Monad m, XmlRpcType a) => Value -> m a Source
Parse a value wrapped in two singleton arrays.
decodeUtf8 :: String -> String Source