File: Introspect.hs

package info (click to toggle)
haskell-haxr 3000.11.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 232 kB
  • sloc: haskell: 1,539; makefile: 16
file content (31 lines) | stat: -rw-r--r-- 971 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 url = remote url "system.listMethods"

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

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


signatures :: String -> String -> IO [Signature]
signatures url name = do
                      sigs <- methodSignature url name
                      return [ (map read as,read r) | (r:as) <- sigs ]

methodInfo :: String -> String -> IO MethodInfo
methodInfo url name = do
                      sigs <- signatures url name
                      help <- methodHelp url name
                      return (name, sigs, help)