    module Network.XmlRpc.Introspect where

    import           Network.XmlRpc.Client
    import           Network.XmlRpc.Internals

    type Signature = ([Type],Type)
    type Help = String
    type MethodInfo = (String,[Signature],Help)

    -- Primitive introspection functions

    listMethods :: String -> IO [String]
    listMethods :: String -> IO [String]
    listMethods url :: String
    url = String -> String -> IO [String]
    forall a. Remote a => String -> String -> a
    remote String
    url "system.listMethods"

    methodSignature :: String -> String -> IO [[String]]
    methodSignature :: String -> String -> IO [[String]]
    methodSignature url :: String
    url = String -> String -> String -> IO [[String]]
    forall a. Remote a => String -> String -> a
    remote String
    url "system.methodSignature"

    methodHelp :: String -> String -> IO String
    methodHelp :: String -> String -> IO String
    methodHelp url :: String
    url = String -> String -> String -> IO String
    forall a. Remote a => String -> String -> a
    remote String
    url "system.methodHelp"

    signatures :: String -> String -> IO [Signature]
    signatures :: String -> String -> IO [Signature]
    signatures url :: String
    url name :: String
    name = do
                          [[String]]
    sigs <- String -> String -> IO [[String]]
    methodSignature String
    url String
    name
                          [Signature] -> IO [Signature]
    forall (m :: * -> *) a. Monad m => a -> m a
    return [ ((String -> Type) -> [String] -> [Type]
    forall a b. (a -> b) -> [a] -> [b]
    map String -> Type
    forall a. Read a => String -> a
    read [String]
    as,String -> Type
    forall a. Read a => String -> a
    read String
    r) | (r :: String
    r:as :: [String]
    as) <- [[String]]
    sigs ]

    methodInfo :: String -> String -> IO MethodInfo
    methodInfo :: String -> String -> IO MethodInfo
    methodInfo url :: String
    url name :: String
    name = do
                          [Signature]
    sigs <- String -> String -> IO [Signature]
    signatures String
    url String
    name
                          String
    help <- String -> String -> IO String
    methodHelp String
    url String
    name
                          MethodInfo -> IO MethodInfo
    forall (m :: * -> *) a. Monad m => a -> m a
    return (String
    name, [Signature]
    sigs, String
    help)