- Web Service support
- Logging and Debugging
- Diversity in Browsers
- HTTP client calls to other servers
- XML parsing and generation
- TCP-level calls to backends (with possibly RPC like abstractions)
- I18N and Localization
I have found two ways of setting up web services.
- Writing the service as a CGI application and run in a general-purpose server such as Apache. The tutorial "Practical Web Programming in Haskell" is a good introduction on how to write a cgi application.
- Pros: quick and easy to write.
- Cons: Too heavy weight if your server is specialized and needs only limited resources.
- Writing a standalone server using Happstack framework (I had mentioned Happs, the predecessor of Happstack in my earlier version of the posting. Thanks to Antoine, I realized there is a more frequently maintained version...)
- Pros: The framework supports lots of things: session management, concurrency,....
The library HStringTemplate is probably the best shot. This Haskell port of the Java StringTemplate library designed by Terrence Parr has a well-thought design. Terrence has done a nice job of thinking over and addressing many issues from which many other templating systems suffer. Unfortunately, and as the name suggests the templates are just strings with holes. I would have liked to see a system where the templates are XHTML documents with holes. This might require some language design and may look like Links (but for use in arbitrary languages). The advantage would be that the templates may now be type checked and statically verified before rendering/filling holes. And if the holes are typed too, it would be possible to guarantee that the filled template would satisfy xhtml syntactic and semantic requirements at compile time.
HTTP Request Support
The HTTP package from HackageDB should be sufficient for this purpose.
Low Level Network Support
To talk to backends that only talk TCP, the package Network should have sufficient support. The extensions found in the package HTTP should also be helpful.
XML Parsing and Generation
The excellent library Haskell XML Toolbox is perfect for this. It allows conversion of XML data into and from Haskell datatypes. It seems to have everything I would need.