[Haskell] Haskell XML RPC

Bjorn Bringert bringert at cs.chalmers.se
Tue Jun 21 08:13:45 EDT 2005


Johannes Waldmann wrote:
> I am looking at the Haskell XML RPC library http://www.haskell.org/haxr/
> First of all, this is a very nice thing to have, and installation is 
> really easy, using Cabal and the packaged source archives.

Hi Johannes,

I'm the maintainer of HaXR, and I'll try to answer your questions as 
well as I can. I'm moving this thread over to the Haskell Libraries list.

> *) Of course I want to dervie XmlRpcType instances automatically.
> The examples suggest  $(asXmlRpcStruct (reifyDecl Person))
> but I cannot get this to compile (with ghc-6.4).  It seems reifyDecl is 
> gone, and  reify  has different type. I worked out this:
> 
> helper name =  asXmlRpcStruct
>     ( ( reify name ) >>= ( \ (TyConI dec) -> return dec ))
> 
> $(helper ''Person)
> 
> Does xmlrpc.cabal should contain a build-dependency
> on template-haskell? (Otherwise I get linker errors.)

Thanks for reporting this. I have fixed it in the development version 
available in the darcs repo at http://cvs.haskell.org/darcs/xmlrpc/ and 
made a new release today which fixes the TH support.

> *) what is the recommended representation that should be created
> for data T = A { .. } | B { .. } | ... i. e. discriminated unions?
> Certainly some solution can be coded, but ...

Hmm, I haven't had a need for that yet, so I haven't thought about it. 
If you come up with a good solution, we could modify THDeriveXmlRpcType 
to do it automatically.

> *) what about the "Java side of things" - perhaps I want (need)
> to interface to a Java Client. If it's Haskell-to-Haskell,
> then both server and client of course can derive their
> XmlRpcType instances from identical data declaraions
> and everything is fine. For intergration with a different language,
> what do you recommend: Start from a Haskell data declaration,
> and derive a Java representation, directly or indirectly?
> Or start from some language independent data declaration,
> as it happens (I assume) for JAXB?

Hmm, I guess it's up to you. If you come up with a good solution, or 
even a tool for autogenerating Haskell types and XmlRpcType instances 
from som language-independent description, I'll be happy to include it 
in HaXR.

/Björn


More information about the Libraries mailing list