Search code examples
haskellyesodhaskell-snap-frameworkhappstack

Haskell and webframeworks


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


Solution

  • 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.