The MFlow package

[Tags:bsd3, library]

MFlow is a Web Framework that turns Web programing back into just ordinary programming by automating all the extra complexities.

The goals of MFlow are:

MFlow try to solve the first requirements using a different approach. The routes are expressed as normal, monadic haskell code in the FlowM monad. Local links point to alternative routes within this monadic computation just like a textual menu in a console application. Any GET page is directly reachable by means of a RESTful URL.

At any moment the flow can respond to the back button or to any RESTful path that the user may paste in the navigation bar. If the procedure is waiting for another different page, the FlowM monad backtrack until the path partially match. From this position on, the execution goes forward until the rest of the path match. Thus, no matter the previous state of the server process, it recover the state of execution appropriate for the request. This way the server process is virtually stateless for any GET request. However, it is possible to store a session state, which may backtrack or not when the navigation goes back and forth. It is up to the programmer. Synchronization between server state and web browser state is supported out-of-the-box.

When the state matters, and user interactions can last for long, such are shopping carts etc. It uses a log for thread state persistence. The server process shut itself down after a programmer defined timeout. Once a new request of the same user arrive, the log is used to recover the process state. There is no need to store a snapshot of every continuation, just the result of each step.

State consistence and transactions are given by the TCache package. It is data cache within the STM monad (Software Transactional Memory). Serialization and deserialization of data is programmer defined, so it can adapt it to any database, although any other database interface can be used. Default persistence in files comes out of the box for rapid development purposes.

The processes interact trough widgets, that are an extension of formlets with additional applicative combinators , formatting, link management, callbacks, modifiers, caching and AJAX. All is coded in pure haskell. Each widget return statically typed data. They can dynamically modify themselves using AJAX internally (ust prefix it with autorefresh). They are auto-contained: they may include their own JavaScript code, server code and client code in a single pure Haskell procedure that can be combined with other widgets with no other configuration.

To combine widgets, applicative combinators are used. Widgets with dynamic behaviours can use the monadic syntax and callbacks.

The interfaces and communications are abstract, but there are bindings for blaze-html, HSP, Text.XHtml and byteString, Hack and WAI but it can be extended to non Web based architectures.

Bindings for hack, and hsp >= 0.8, are not compiled by Hackage, and do not appear, but are included in the package files. To use them, add then to the exported modules and execute cabal install

The version 0.3.1 includes:

The version 0.3 added: - RESTful URLs:

The version 0.2 added better WAI integration, higher level dynamic Widgets, content management, multilanguage, blaze-html support, stateful ajax for server-side control, user-defined data in sessions and widget requirements for automatic installation of scripts, CSS and server flows.

The version 0.1 had transparent back button management, cached widgets, callbacks, modifiers, heterogeneous formatting, AJAX, and WAI integration.

See MFlow.Forms for details

To do:

In this release, this issue has been fixed:


Versions 0.0.0, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.0.5,,,,,,,,,,,,,,,,,,,,,,,,,, 0.3.3, 0.4.0, 0.4.1, 0.4.2, 0.4.4, 0.4.5,,,,,,,,,,,,,,
Dependencies base (>4.0 && <5), blaze-html, blaze-markup, bytestring, case-insensitive, conduit, containers, directory, extensible-exceptions, hamlet, http-types, monadloc, mtl, old-time, parsec, random, RefSerialize, stm (>2), TCache, text, transformers, utf8-string, vector, wai, warp, Workflow, xhtml [details]
License BSD3
Author Alberto Gómez Corona
Stability experimental
Category Web, Application Server
Bug tracker
Source repository head: git clone
Uploaded Thu Aug 8 14:08:03 UTC 2013 by AlbertoCorona
Distributions LTSHaskell:, NixOS:, Stackage:, Tumbleweed:
Downloads 13042 total (35 in the last 30 days)
0 []
Status Docs uploaded by user
Build status unknown [no reports yet]




Maintainer's Corner

For package maintainers and hackage trustees