1

I started developing an application (some boring accounting software for inhouse use) and decided to make it web-based as this would solve a couple of problems in one go.

Now with a couple of webframeworks for Haskell to choose from (happstack, yesod and snap) I still begin feeling the pain again of having to deal with HTML, CSS and devishly clever wired JavaScript.

Uhm.

So what the hell I thought might as well try going all the AJAX way and do the UI in either Cappuccino or SproutCore. (SEO is not an issue here).

But now I wouldn't really need a full blown web-framework such as one of the three above, an HTTP server which could serve data wrapped in JSON or XML should in theory be enough.

Would there now still be a point in using either one of those three?

And most of all how feasible is the approach?

Günther

Guenni
  • 449
  • 2
  • 8
  • I'm curious how your accounting application came along. I am writing some accounting applications in Haskell as well. I'll try to link to it here, once we post it to the web. –  May 09 '13 at 00:21

2 Answers2

4

I think your question might be verging on "overly broad" here - so I guess it depends on your requirements. You probably don't need things like type-safe URLs if all you are doing is exchanging JSON and in fact the Yesod book has a JSON web service example which avoids using Yesod itself and instead builds on the underlying WAI package.

I can't comment on Snap and Happstack since I haven't really looked into them much, but there are other options too. For example Scotty adds a simpler layer on top of WAI which should be more than adequate for building a basic server without much of a learning curve. I also found reading Scotty's code was a good way to build an understanding of WAI which is also very useful if you are developing more complicated Yesod apps.

Shaun the Sheep
  • 22,353
  • 1
  • 72
  • 100
  • Hi Luke, guilty as charged with being overly broad. Going this way, ie. using the server for merely for JSON and XML and no UI is my first attempt and I thus was also seeking reassurance. – Guenni Mar 14 '13 at 00:21
2

All of the big three web frameworks have their own web servers. Yesod's server is warp. Snap's server is snap-server. Happstack's server is happstack-server. They all have fairly low level APIs that would be appropriate for your application. Warp's API is defined in wai. The Snap server's API is defined in snap-core. Happstack doesn't have a separate package for its API, however they have a simplified version of it in the happstack-lite package.

I would recommend that you take a look at the APIs and use whichever one you like best.

mightybyte
  • 7,282
  • 3
  • 23
  • 39