Personal tools

Web/Frameworks

From HaskellWiki

< Web(Difference between revisions)
Jump to: navigation, search
m (Removed announce, the home page is sufficient)
(MFlow)
(35 intermediate revisions by 15 users not shown)
Line 1: Line 1:
 
[[Category:Web|*]]
 
[[Category:Web|*]]
  +
{{Web infobox}}
   
Below is a list of Haskell web frameworks.
+
Content from [[Web]] should be merged here.
   
== Hajax ==
+
Below is a list of known to be active Haskell web frameworks. Rather than one framework to rule them all, Haskell provides several options. You can view the [[Web/Deploy]] page to get an idea of how you might deploy an application written in some of these frameworks.
   
Hajax is a proposal to create a Haskell-based tool to program 'stand-alone' Ajax applications.
+
See also: there are also many [[Web/Frameworks/Inactive|inactive web frameworks]] to draw inspiration from
 
'''Wiki page:''' http://www.haskell.org/haskellwiki/Hajax
 
   
 
== Happstack ==
 
== Happstack ==
Line 11: Line 12:
 
Happstack is a Haskell web framework. Happstack is designed so that developers can prototype quickly, deploy painlessly, scale massively, operate reliably, and change easily. It supports GNU/Linux, OS X, FreeBSD, and Windows environments.
 
Happstack is a Haskell web framework. Happstack is designed so that developers can prototype quickly, deploy painlessly, scale massively, operate reliably, and change easily. It supports GNU/Linux, OS X, FreeBSD, and Windows environments.
   
'''Author:''' Happstack team, HAppS LLC
+
{| class="wikitable"
  +
! License
  +
| BSD3
  +
|-
  +
! Author:
  +
| Happstack team, HAppS LLC
  +
|-
  +
! Maintainer:
  +
| Happstack team <happs@googlegroups.com>
  +
|-
  +
! Home page:
  +
| http://happstack.com/
  +
|-
  +
! Documentation:
  +
| http://www.happstack.com/c/view-page-slug/3/documentation/
  +
|-
  +
! Package & repositories
  +
| [http://hackage.haskell.org/package/happstack-server Hackage] - [http://patch-tag.com/r/mae/happstack Darcs]
  +
|}
   
'''Maintainer:''' Happstack team <happs@googlegroups.com>
+
[http://happstack.com/ Happstack] is a complete web framework. The main component is [http://hackage.haskell.org/package/happstack-server happstack-server]: an integrated HTTP server, routing combinators, fileserving, etc. In addition, a number of packages that used to be coupled to Happstack have now been decoupled from it, but remain promoted and documented for use with Happstack:
   
'''Home page:''' http://happstack.com/index.html
+
* [http://hackage.haskell.org/package/safecopy safecopy]: datatype serialization and migration support
  +
* [http://hackage.haskell.org/package/acid-state acid-state]: a powerful NoSQL ACID storage system with native support for Haskell types
   
'''Documentation:''' http://happstack.com/docs
+
It also includes integration with many 3rd party libraries including:
   
'''Package & repositories'''
+
*templating: [http://hackage.haskell.org/package/blaze-html Blaze HTML], [http://www.yesodweb.com/book/shakespearean-templates Hamlet], [[HSP]], [[HStringTemplate]], [[Heist]], and more
  +
*forms: [http://hackage.haskell.org/package/reform reform]
  +
*routing: [http://hackage.haskell.org/package/web-routes web-routes] type-safe urls and routing
  +
*databases: can be used with most [[Database interfaces]] with no special support required
   
* Hackage: http://hackage.haskell.org/package/happstack
+
See the [http://happstack.com/ Happstack Home Page] for more information and to learn how to get support via IRC and mailing lists.
* Darcs: http://patch-tag.com/r/mae/happstack/pullrepo
 
   
== Haskell on a Horse ==
+
== Snap ==
   
Haskell on a Horse (HoH) is a combinatorial web framework for the programming language Haskell. It is currently at an early, unsettled stage of development. It is available under the "BSD3" open-source license.
+
Snap is a simple web development framework for unix systems, written in the Haskell programming language.
   
'''License''' BSD3
+
Snap is well-documented and has a test suite with a high level of code coverage, but it is early-stage software with still-evolving interfaces. Snap is therefore likely to be most appropriate for early adopters and potential contributors.
   
'''Author''' Jason Hart Priestley
+
* A fast HTTP server library with an optional high-concurrency backend using the libev event loop library
  +
* A sensible and clean monad for web programming
  +
* An XML-based templating system for generating HTML
   
'''Maintainer''' jason@on-a-horse.org
+
{| class="wikitable"
  +
! License:
  +
| BSD3
  +
|-
  +
! Author:
  +
| James Sanders, Gregory Collins, Doug Beardsley
  +
|-
  +
! Maintainer:
  +
| snap@snapframework.com
  +
|-
  +
! Home page:
  +
| http://snapframework.com/
  +
|-
  +
! Documentation:
  +
| http://snapframework.com/docs
  +
|-
  +
! Package & repositories
  +
| [http://hackage.haskell.org/package/snap-server Hackage] - [http://git.snapframework.com/snap-server.git Git]
  +
|}
   
'''Home page:''' http://haskell.on-a-horse.org/
+
== Yesod ==
   
'''Package & repositories'''
+
Yesod is designed for RESTful, type-safe, performant web apps. By leveraging quasi-quotation for the more boilerplate tasks, we get concise web apps with high levels of type safety. Its Hamlet templates are compile-time checked for correctness, and the controller (web-routes-quasi) uses type-safe URLs to make certain you are only generating valid URLs. It loosely follows Model/View/Controller principles.
   
* Hackage: http://hackage.haskell.org/package/on-a-horse
+
{| class="wikitable"
  +
! License:
  +
| BSD3
  +
|-
  +
! Author:
  +
| Michael Snoyman <michael@snoyman.com>
  +
|-
  +
! Maintainer:
  +
| Michael Snoyman <michael@snoyman.com>
  +
|-
  +
! Announcement:
  +
| http://www.haskell.org/pipermail/haskell-cafe/2010-March/074271.html
  +
|-
  +
! Home page:
  +
| http://www.yesodweb.com/
  +
|-
  +
! Documentation:
  +
| http://www.yesodweb.com/book
  +
|-
  +
! Screencast:
  +
| http://www.yesodweb.com/page/screencasts
  +
|-
  +
! Package & repositories
  +
| [http://hackage.haskell.org/package/yesod Hackage] - [https://github.com/yesodweb/yesod Github]
  +
|}
   
== Haskell web tool kit ==
+
[http://docs.yesodweb.com/ Yesod] is a full-featured web framework. It takes a modular approach to development, so many parts of the framework such as [http://www.yesodweb.com/book/shakespearean-templates Hamlet] and [http://www.yesodweb.com/book/persistent Persistent] are available as standalone packages. However, put together, Yesod provides you with solutions for templating, routing, persistence, sessions, JSON, authentication/authorization, and more. Yesod's major guiding principle is type safety: if your application compiles, it works.
   
Haskell Web Toolkit (further referred to as HsWTK) is a thin layer built on top of DOM interfaces. It provides program interfaces to compose static layout of a web application page, and to hook up visual elements of an application to event handlers and XML HTTP communication means. HsWTK hides the low-level DOM APIs where possible; however their knowledge may be necessary to develop certain types of visual components and event handlers.
+
Yesod is very well documented through a combination of haddocks and the [http://docs.yesodweb.com/book Yesod book].
   
'''Wiki page:''' [[Haskell_in_web_browser#Haskell_web_toolkit]]
+
Yesod is built on [http://hackage.haskell.org/package/wai WAI], or the Web Application Interface. This is similar to WSGI in Python or Rack in Ruby. It provides a single interface that all applications can target and work on multiple backends. Backends exist for CGI, FastCGI, SCGI, development server (auto-recompile) and even a Webkit-powered desktop version.
   
== HSP ==
+
But the premier backend is [http://hackage.haskell.org/package/warp Warp]: a very simple web server which, at the time of writing, is the fastest Haskell has to offer. You can read more in its [http://docs.yesodweb.com/blog/announcing-warp release announcement] and see some [http://www.yesodweb.com/blog/2011/02/warp-speed-ahead followup benchmarks]. Warp is already powering Yesod; some other major players that are planning a move are Hoogle and Happstack.
   
Haskell Server Pages (HSP) is an extension of vanilla Haskell, targetted at the task of writing dynamic server-side web pages. Features include:
+
You can see a [https://github.com/yesodweb/yesod/wiki/Powered-by-Yesod list of Yesod-powered sites and packages], or check out the [https://github.com/snoyberg/haskellers source code for Haskellers]. Most discussions for Yesod take place on the [http://groups.google.com/group/yesodweb yesodweb list], so feel free to join in and ask any questions you have, the Yesod community is very beginner-friendly.
   
Embedded XML syntax
+
== miku ==
   
A (low-to-mid-level) programming model for writing dynamic web pages
+
A simple library for fast web prototyping in Haskell, inspired by Ruby's Rack and Sinatra.
   
A cgi-handler utility (as a separate package, hsp-cgi)
+
{| class="wikitable"
+
! License
For details on usage, please see the website, and the author's thesis.
+
| BSD3
+
|-
'''License:''' BSD3
+
! Author
+
| Wang, Jinjing
'''Author:''' Niklas Broberg, Joel Bjornson
+
|-
+
! Maintainer
'''Maintainer:''' Niklas Broberg <niklas.broberg@chalmers.se>
+
| Wang, Jinjing <nfjinjing@gmail.com>
+
|-
'''Home page:''' http://code.google.com/p/hsp/
+
! Package & repositories
+
| [http://hackage.haskell.org/package/miku Hackage] - [http://github.com/nfjinjing/miku Github]
'''Wiki page:''' [[HSP]]
+
|}
 
== HWSProxyGen ==
 
 
This website presents a web services proxy generator for the Haskell functional language, implemented in Haskell and C#. The final purpose is to show that Haskell and functional languages in general can be used as a viable way to the implementation of distributed components and applications, interacting with services implemented in different languages and/or platforms.
 
 
Homepage: http://www.cin.ufpe.br/~haskell/hwsproxygen/
 
 
== hvac ==
 
 
The aim of hvac is to provide an environment that makes the creation of lightweight fastcgi-based web applications as simple as possible, with an emphasis on concise, declarative style code, correct concurrent transactional logic, and transparency in adding caching combinators.
 
 
'''Announcement:''' http://fmapfixreturn.wordpress.com/2008/03/23/ann-hvac-01b-a-transactional-declarative-framework-for-lightweight-web-applications/
 
 
'''Documentation:''' http://community.haskell.org/~sclv/hvac/html_docs/hvac/
 
 
'''Home page:''' http://community.haskell.org/~sclv/hvac/
 
 
== loli ==
 
 
A simple library for fast web prototyping in Haskell.
 
 
'''License''' BSD3
 
 
'''Author''' Wang, Jinjing
 
 
'''Maintainer''' Wang, Jinjing <nfjinjing@gmail.com>
 
 
'''Package & repositories'''
 
 
* Hackage: http://hackage.haskell.org/package/loli
 
* Github: http://github.com/nfjinjing/loli
 
   
 
== Lemmachine ==
 
== Lemmachine ==
Line 75: Line 76:
 
[http://github.com/larrytheliquid/Lemmachine#readme More information]
 
[http://github.com/larrytheliquid/Lemmachine#readme More information]
   
'''Author''': Larry Diehl
+
{| class="wikitable"
+
! Author
'''Packages & repositories'''
+
| Larry Diehl
+
|-
Github: http://github.com/larrytheliquid/Lemmachine
+
! Packages & repositories
  +
| [http://github.com/larrytheliquid/Lemmachine Github]
  +
|}
   
 
== mohws ==
 
== mohws ==
Line 85: Line 86:
 
A web server with a module system and support for CGI. Based on Simon Marlow's original Haskell Web Server.
 
A web server with a module system and support for CGI. Based on Simon Marlow's original Haskell Web Server.
   
'''License:''' BSD3
+
{| class="wikitable"
+
!License:
'''Copyright:''' Simon Marlow, Bjorn Bringert
+
|BSD3
+
|-
'''Author:''' Simon Marlow, Bjorn Bringert <bjorn@bringert.net>
+
!Copyright:
+
|Simon Marlow, Bjorn Bringert
'''Maintainer:''' Henning Thielemann <webserver@henning-thielemann.de>
+
|-
+
!Author:
'''Packages & repositories'''
+
|Simon Marlow, Bjorn Bringert <bjorn@bringert.net>
+
|-
* Hackage: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mohws
+
!Maintainer:
* Darcs: http://code.haskell.org/mohws/
+
|Henning Thielemann <webserver@henning-thielemann.de>
  +
|-
  +
!Packages & repositories
  +
|[http://hackage.haskell.org/cgi-bin/hackage-scripts/package/mohws Hackage] - [http://code.haskell.org/mohws/ Darcs]
  +
|}
   
 
== Salvia ==
 
== Salvia ==
Line 106: Line 107:
 
This Salvia package itself can be separated into three different parts: the interface, the handlers and the implementation. The interface module defines a number of type classes that the user can build the web application against. Reading the request object, writing to the response, or gaining direct access to the socket, all of these actions are reflected using one type class aspect in the interface. The handlers are self contained modules that implement a single aspect of the Salvia web server. The handlers expose their interface requirements in their type context. Salvia can have multiple implementations which can be switched by using different instances for the interface type classes. This package has only one implementation, a simple accepting socket loop server. The salvia-extras package has two additional implementations. Keeping a clear distinction between the abstract server aspects and the actual implementation makes it very easy to migrate existing web application to different back-ends.
 
This Salvia package itself can be separated into three different parts: the interface, the handlers and the implementation. The interface module defines a number of type classes that the user can build the web application against. Reading the request object, writing to the response, or gaining direct access to the socket, all of these actions are reflected using one type class aspect in the interface. The handlers are self contained modules that implement a single aspect of the Salvia web server. The handlers expose their interface requirements in their type context. Salvia can have multiple implementations which can be switched by using different instances for the interface type classes. This package has only one implementation, a simple accepting socket loop server. The salvia-extras package has two additional implementations. Keeping a clear distinction between the abstract server aspects and the actual implementation makes it very easy to migrate existing web application to different back-ends.
   
'''License:''' BSD3
+
{| class="wikitable"
  +
! License:
  +
| BSD3
  +
|-
  +
! Author:
  +
| Sebastiaan Visser
  +
|-
  +
! Maintainer:
  +
| sfvisser@cs.uu.nl
  +
|-
  +
! Announcement:
  +
| http://www.haskell.org/pipermail/haskell-cafe/2010-March/074870.html
  +
|-
  +
! Package & repositories
  +
| [http://hackage.haskell.org/package/salvia Hackage] - [http://github.com/sebastiaanvisser/salvia Git]
  +
|}
   
'''Author:''' Sebastiaan Visser
+
== Scotty ==
   
'''Maintainer:''' sfvisser@cs.uu.nl
+
A Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp. Sinatra + Warp = Scotty.
 
'''Announcement:''' http://www.haskell.org/pipermail/haskell-cafe/2010-March/074870.html
 
 
'''Package & repositories'''
 
 
* Hackage: http://hackage.haskell.org/package/salvia
 
* Git: http://github.com/sebastiaanvisser/salvia
 
 
== Snap ==
 
 
Snap is a simple web development framework for unix systems, written in the Haskell programming language.
 
 
Snap is well-documented and has a test suite with a high level of code coverage, but it is early-stage software with still-evolving interfaces. Snap is therefore likely to be most appropriate for early adopters and potential contributors.
 
 
* A fast HTTP server library with an optional high-concurrency backend using the libev event loop library
 
* A sensible and clean monad for web programming
 
* An XML-based templating system for generating HTML
 
 
'''License:''' BSD3
 
 
'''Author:''' James Sanders, Gregory Collins, Doug Beardsley
 
 
'''Maintainer:''' snap@snapframework.com
 
 
'''Home page:''' http://snapframework.com/
 
 
'''Documentation:''' http://snapframework.com/docs
 
 
'''Package & repositories'''
 
 
* Hackage: http://hackage.haskell.org/package/snap-server
 
* Git: http://git.snapframework.com/snap-server.git
 
 
== Turbinado ==
 
 
Turbinado is a Rails-ish MVC web framework for Haskell. Turbinado gives you all of the benefits of coding in Haskell and adds:
 
http://www.cin.ufpe.br/~haskell/hwsproxygen/
 
* A fast HTTP server with static- and dynamic-content serving capabilities;
 
* Views built using HTML, HAML or Haskell templating syntax;
 
* Automagic recompilation of Controllers, Layouts and Views;
 
* A database ORM to make database interaction (especially with PostgreSQL) joyful;
 
* A rich set of tags to make designing pages simpler;.
 
 
'''Author:''' Alson Kemp
 
 
'''Package & repositories:'''
 
 
* Github: http://github.com/alsonkemp/turbinado
 
 
== Yesod ==
 
 
Yesod is designed for RESTful, type-safe, performant web apps. By leveraging quasi-quotation for the more boilerplate tasks, we get concise web apps with high levels of type safety. Its Hamlet templates are compile-time checked for correctness, and the controller (web-routes-quasi) uses type-safe URLs to make certain you are only generating valid URLs. It loosely follows Model/View/Controller principles.
 
   
'''License:''' BSD3
+
Scotty is the cheap and cheerful way to write RESTful, declarative web applications.
   
'''Author:''' Michael Snoyman <michael@snoyman.com>
+
* A page is as simple as defining the verb, url pattern, and Text content.
  +
* It is template-language agnostic. Anything that returns a Text value will do.
  +
* Conforms to WAI Application interface.
  +
* Uses very fast Warp webserver by default.
   
'''Maintainer:''' Michael Snoyman <michael@snoyman.com>
+
{| class="wikitable"
  +
! License:
  +
| BSD3
  +
|-
  +
! Author:
  +
| Andrew Farmer
  +
|-
  +
! Maintainer:
  +
| Andrew Farmer
  +
|-
  +
! Home page:
  +
| http://ittc.ku.edu/csdl/fpg/Tools/Scotty
  +
|-
  +
! Documentation:
  +
| http://hackage.haskell.org/package/scotty
  +
|-
  +
! Package & repositories
  +
| [http://hackage.haskell.org/package/scotty Hackage] - [https://github.com/xich/scotty Git]
  +
|}
   
'''Announcement:''': http://www.haskell.org/pipermail/haskell-cafe/2010-March/074271.html
+
== MFlow==
   
'''Home page:''' http://www.yesodweb.com/
+
A Haskell application server ++ Web Framework. MFlow is a shorthand for "Message Flow". It is a continuation-based framework without continuations. Instead of other continuation based frameworks like Ocsigen(Ocaml), Coccoon (javascript) or Seaside (Smalltalk), it is based on a backtracking monad that keep the synchornization of the execution state with the user navigation. Since the discontinuation of [http://www.informatik.uni-freiburg.de/~thiemann/WASH/ WASH], MFlow is the only continuation-style framework written in Haskell to date.
   
'''Documentation:''' http://docs.yesodweb.com/yesod/
+
Unlike real continuations, the state in MFlow applications is pretty small and serializable, so it is horizontally scalable. The navigation in a MFlow application is safe at compilation time, since even the internal HTML links are checked by the compiler. The code is very short and has little configuration.
   
'''Screencast:''' http://www.youtube.com/watch?v=BEWJnDgrmp0
+
It uses standard Haskell web libraries and/or techniques: WAI, Warp, Blaze HTML, HSP. Its core is server and rendering independent. A kind of extended [http://groups.inf.ed.ac.uk/links/formlets/ formlets] are used to create self contained components, called widgets. They have formatting, Ajax, and server code. They can be composed to create the user interface.
   
'''Package & repositories'''
+
A MFlow application resembles a console application. This is an example of a complete application with three pages. It ask for two numbers and return the result. At any time, even if the user press the back button, the state is synchronized with the navigation. Each page has its own URL so it is RESTful to a certain extent. It is planned to have REST-style URL in the future.
   
* Hackage: http://hackage.haskell.org/package/hyena
+
module Main where
* Github: http://github.com/tibbe/hyena
+
import MFlow.Wai.Blaze.Html.All
   
== WASH ==
+
main= do
  +
addMessageFlows [("sum", transient . runFlow $ sumIt )]
  +
wait $ run 8081 waiMessageFlow
   
An extended version of Simon Marlow's webserver (hws) that runs WASH modules as servlets. WASH modules are compiled transparently and dynamically loaded into the running server. Each servlet runs in one of three modes: LogOnly (using a log to reconstruct the current state like WASH's CGI implementation), StateIDOnly (running a thread for each session and continuing in the same thread with each form submission), LogAndState (use a thread for efficiency and keep the log for robustness).
+
sumIt= do
  +
setHeader $ html . body
  +
n1 <- ask $ p << "give me the first number"
  +
++> getInt Nothing
  +
<** submitButton "send"
   
'''Author:''' Simon Marlow
+
n2 <- ask $ p << "give me the second number"
  +
++> getInt Nothing
  +
<** submitButton "send"
   
'''Home page:''' http://www.informatik.uni-freiburg.de/~thiemann/WASH/#wsp
+
ask $ p << ("the result is " ++ show (n1 + n2))
  +
++> wlink () << p << "click here"
  +
   
== Web functions ==
 
   
From the site: "WebFunctions is a domain specific embedded language for web authoring, implemented in Haskell. The functionality of the WebFunctions framework was inspired by Apple's WebObjects. We claim it is easier to use since the Haskell type checker makes a lot of extra checks, that are absent from the Apple framework. Unfortunately we do not yet have all the nice tooling and special editors, but we are working on this."
+
{| class="wikitable"
  +
! License:
  +
| BSD3
  +
|-
  +
! Author:
  +
| Alberto Gómez Corona
  +
|-
  +
! Maintainer:
  +
| Alberto Gómez Corona
  +
|-
  +
! Home page:
  +
| http://haskell-web.blogspot.com
  +
|-
  +
! Documentation:
  +
| http://hackage.haskell.org/package/MFlow
  +
[https://docs.google.com/file/d/0B2-x2MmiuA32b0RndnZTdTVUb0E MFlow paper]
  +
|-
  +
! Package & repositories
  +
| [http://hackage.haskell.org/package/MFlow Hackage] - [https://github.com/agocorona/MFlow Git]
  +
|}
   
'''Author:''' Robert Van Herk
+
==See also==
   
'''Home page:''' http://www.cs.uu.nl/wiki/WebFunctions/WebHome
+
* [[Web/Framework survey]]

Revision as of 16:23, 15 May 2013

Haskell Web Development

Software:
Servers - Libraries - Frameworks
Deploy - Cloud
Interfaces to frameworks
Databases and Persistence
Testing and Verification
Content Management

Community & Research:
Forums and Discussion
Literature (research, talks and blogs)
Existing Haskell web applications
Ongoing projects and ideas

Content from Web should be merged here.

Below is a list of known to be active Haskell web frameworks. Rather than one framework to rule them all, Haskell provides several options. You can view the Web/Deploy page to get an idea of how you might deploy an application written in some of these frameworks.

See also: there are also many inactive web frameworks to draw inspiration from

Contents

1 Happstack

Happstack is a Haskell web framework. Happstack is designed so that developers can prototype quickly, deploy painlessly, scale massively, operate reliably, and change easily. It supports GNU/Linux, OS X, FreeBSD, and Windows environments.

License BSD3
Author: Happstack team, HAppS LLC
Maintainer: Happstack team <happs@googlegroups.com>
Home page: http://happstack.com/
Documentation: http://www.happstack.com/c/view-page-slug/3/documentation/
Package & repositories Hackage - Darcs

Happstack is a complete web framework. The main component is happstack-server: an integrated HTTP server, routing combinators, fileserving, etc. In addition, a number of packages that used to be coupled to Happstack have now been decoupled from it, but remain promoted and documented for use with Happstack:

  • safecopy: datatype serialization and migration support
  • acid-state: a powerful NoSQL ACID storage system with native support for Haskell types

It also includes integration with many 3rd party libraries including:

See the Happstack Home Page for more information and to learn how to get support via IRC and mailing lists.

2 Snap

Snap is a simple web development framework for unix systems, written in the Haskell programming language.

Snap is well-documented and has a test suite with a high level of code coverage, but it is early-stage software with still-evolving interfaces. Snap is therefore likely to be most appropriate for early adopters and potential contributors.

  • A fast HTTP server library with an optional high-concurrency backend using the libev event loop library
  • A sensible and clean monad for web programming
  • An XML-based templating system for generating HTML
License: BSD3
Author: James Sanders, Gregory Collins, Doug Beardsley
Maintainer: snap@snapframework.com
Home page: http://snapframework.com/
Documentation: http://snapframework.com/docs
Package & repositories Hackage - Git

3 Yesod

Yesod is designed for RESTful, type-safe, performant web apps. By leveraging quasi-quotation for the more boilerplate tasks, we get concise web apps with high levels of type safety. Its Hamlet templates are compile-time checked for correctness, and the controller (web-routes-quasi) uses type-safe URLs to make certain you are only generating valid URLs. It loosely follows Model/View/Controller principles.

License: BSD3
Author: Michael Snoyman <michael@snoyman.com>
Maintainer: Michael Snoyman <michael@snoyman.com>
Announcement: http://www.haskell.org/pipermail/haskell-cafe/2010-March/074271.html
Home page: http://www.yesodweb.com/
Documentation: http://www.yesodweb.com/book
Screencast: http://www.yesodweb.com/page/screencasts
Package & repositories Hackage - Github

Yesod is a full-featured web framework. It takes a modular approach to development, so many parts of the framework such as Hamlet and Persistent are available as standalone packages. However, put together, Yesod provides you with solutions for templating, routing, persistence, sessions, JSON, authentication/authorization, and more. Yesod's major guiding principle is type safety: if your application compiles, it works.

Yesod is very well documented through a combination of haddocks and the Yesod book.

Yesod is built on WAI, or the Web Application Interface. This is similar to WSGI in Python or Rack in Ruby. It provides a single interface that all applications can target and work on multiple backends. Backends exist for CGI, FastCGI, SCGI, development server (auto-recompile) and even a Webkit-powered desktop version.

But the premier backend is Warp: a very simple web server which, at the time of writing, is the fastest Haskell has to offer. You can read more in its release announcement and see some followup benchmarks. Warp is already powering Yesod; some other major players that are planning a move are Hoogle and Happstack.

You can see a list of Yesod-powered sites and packages, or check out the source code for Haskellers. Most discussions for Yesod take place on the yesodweb list, so feel free to join in and ask any questions you have, the Yesod community is very beginner-friendly.

4 miku

A simple library for fast web prototyping in Haskell, inspired by Ruby's Rack and Sinatra.

License BSD3
Author Wang, Jinjing
Maintainer Wang, Jinjing <nfjinjing@gmail.com>
Package & repositories Hackage - Github

5 Lemmachine

Lemmachine is a REST'ful web framework that makes it easy to get HTTP right by exposing users to overridable hooks with sane defaults. The main architecture is a copy of Erlang-based Webmachine, which is currently the best documentation reference (for hooks & general design).

Lemmachine stands out from the dynamically typed Webmachine by being written in dependently typed Agda. The goal of the project is to show the advantages gained from compositional testing by taking advantage of proofs being inherently compositional. See proofs for examples of universally quantified proofs (tests over all possible input values) written against the default resource, which does not override any hooks.

More information

Author Larry Diehl
Packages & repositories Github

6 mohws

A web server with a module system and support for CGI. Based on Simon Marlow's original Haskell Web Server.

License: BSD3
Copyright: Simon Marlow, Bjorn Bringert
Author: Simon Marlow, Bjorn Bringert <bjorn@bringert.net>
Maintainer: Henning Thielemann <webserver@henning-thielemann.de>
Packages & repositories Hackage - Darcs

7 Salvia

Salvia is a feature rich modular web server and web application framework that can be used to write dynamic websites in Haskell. From the lower level protocol code up to the high level application code, everything is written as a Salvia handler. This approach makes the server extremely extensible. To see a demo of a Salvia website, please see the salvia-demo package.

All the low level protocol code can be found in the salvia-protocol package, which exposes the datatypes, parsers and pretty-printers for the URI, HTTP, Cookie and MIME protocols.

This Salvia package itself can be separated into three different parts: the interface, the handlers and the implementation. The interface module defines a number of type classes that the user can build the web application against. Reading the request object, writing to the response, or gaining direct access to the socket, all of these actions are reflected using one type class aspect in the interface. The handlers are self contained modules that implement a single aspect of the Salvia web server. The handlers expose their interface requirements in their type context. Salvia can have multiple implementations which can be switched by using different instances for the interface type classes. This package has only one implementation, a simple accepting socket loop server. The salvia-extras package has two additional implementations. Keeping a clear distinction between the abstract server aspects and the actual implementation makes it very easy to migrate existing web application to different back-ends.

License: BSD3
Author: Sebastiaan Visser
Maintainer: sfvisser@cs.uu.nl
Announcement: http://www.haskell.org/pipermail/haskell-cafe/2010-March/074870.html
Package & repositories Hackage - Git

8 Scotty

A Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp. Sinatra + Warp = Scotty.

Scotty is the cheap and cheerful way to write RESTful, declarative web applications.

  • A page is as simple as defining the verb, url pattern, and Text content.
  • It is template-language agnostic. Anything that returns a Text value will do.
  • Conforms to WAI Application interface.
  • Uses very fast Warp webserver by default.
License: BSD3
Author: Andrew Farmer
Maintainer: Andrew Farmer
Home page: http://ittc.ku.edu/csdl/fpg/Tools/Scotty
Documentation: http://hackage.haskell.org/package/scotty
Package & repositories Hackage - Git

9 MFlow

A Haskell application server ++ Web Framework. MFlow is a shorthand for "Message Flow". It is a continuation-based framework without continuations. Instead of other continuation based frameworks like Ocsigen(Ocaml), Coccoon (javascript) or Seaside (Smalltalk), it is based on a backtracking monad that keep the synchornization of the execution state with the user navigation. Since the discontinuation of WASH, MFlow is the only continuation-style framework written in Haskell to date.

Unlike real continuations, the state in MFlow applications is pretty small and serializable, so it is horizontally scalable. The navigation in a MFlow application is safe at compilation time, since even the internal HTML links are checked by the compiler. The code is very short and has little configuration.

It uses standard Haskell web libraries and/or techniques: WAI, Warp, Blaze HTML, HSP. Its core is server and rendering independent. A kind of extended formlets are used to create self contained components, called widgets. They have formatting, Ajax, and server code. They can be composed to create the user interface.

A MFlow application resembles a console application. This is an example of a complete application with three pages. It ask for two numbers and return the result. At any time, even if the user press the back button, the state is synchronized with the navigation. Each page has its own URL so it is RESTful to a certain extent. It is planned to have REST-style URL in the future.

   module Main where
   import MFlow.Wai.Blaze.Html.All
   main= do
     addMessageFlows  [("sum", transient . runFlow $ sumIt )]
     wait $ run 8081 waiMessageFlow
   sumIt= do
     setHeader $ html . body
     n1 <- ask $   p << "give me the first number" 
               ++> getInt Nothing 
               <** submitButton "send"
     n2 <- ask $   p << "give me the second number" 
               ++> getInt Nothing 
               <** submitButton "send"
     ask $   p << ("the result is " ++ show (n1 + n2)) 
         ++> wlink () << p << "click here"
 


License: BSD3
Author: Alberto Gómez Corona
Maintainer: Alberto Gómez Corona
Home page: http://haskell-web.blogspot.com
Documentation: http://hackage.haskell.org/package/MFlow
MFlow paper
Package & repositories Hackage - Git

10 See also