Portability | GHC |
---|---|
Stability | experimental |
Maintainer | marius@monkey.org |
BERT-RPC server (http://bert-rpc.org/). This implements the client RPC call/reply logic. Only synchronous requests are supported at this time.
- data DispatchResult
- serve :: Transport -> (String -> String -> [Term] -> IO DispatchResult) -> IO ()
Documentation
data DispatchResult Source
Serve
To serve requests, create a transport and call serve
with a
dispatch function.
main = do t <- fromHostPort "" 8080 serve t dispatch dispatch "calc" "add" [IntTerm a, IntTerm b] = return $ Right $ IntTerm (a + b) dispatch _ _ _ = do return $ Left "no such m/f!"