Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are there any more original, more functional Haskell web-frameworks? [closed]

I looked at Haskell web frameworks like Snap and Yesod. Most seem to implement an MVC-ish approach reminding me of web frameworks like Ruby on Rails. Yes, MVC can be achieved with FP, but IMHO it doesn't show the great advantages of an FP approach. As HTTP is a stateless protocol, I would have hoped that there might be an Haskell framework that takes a more original, more pure functional approach. Are there any?

like image 928
Ward Bekker Avatar asked Jan 04 '11 20:01

Ward Bekker


2 Answers

I'm not sure which features in FP you would like a framework to utilize, but I think Yesod uses some features to great benefit. (Happstack does as well, but I'm just not as familiar with it.)

  • Type-safe URLs eliminate an entire class of typo-generated bugs, plus automatically deal with input validation.

  • Proper typing practically eliminates XSS attacks.

  • Depending on the scope of data you're dealing with, using either STM or MVars for your storage needs make it easy to avoid race conditions and deadlocks in multi-threaded applications.

I'm sure there's a lot more that I'm not thinking of, but I hope that makes the point. But perhaps what you're looking for is something like a continuation-based framework. I personally think they're a bad idea (I'm a believer in REST), but I suppose it might seem more "functional."

like image 111
Michael Snoyman Avatar answered Oct 20 '22 03:10

Michael Snoyman


It depends what you're trying to achieve. If by stateless you actually mean stateless, I use the templating framework Hakyll to generate static pages. It has an interesting structure to deal with dependencies and file updates.

like image 44
Jason Reich Avatar answered Oct 20 '22 03:10

Jason Reich