A. Farmer and A. Gill, “Haskell DSLs for interactive web services,” in 1st International Workshop on Cross-model Language Design and Implementation, Sep 2012.



Robust cross-platform GUI-based applications are challenging to write in Haskell, not because providing hooks into existing GUI frameworks is hard, but because these hooks are both platform dependent and prone to rapid bit-rot. Browser-based user interfaces implemented using Javascript and HTML5 offer some relief from this situation, providing a standardized cross-platform API. However, Javascript is a client-side scripting language, and a traditional shallow, foreign-function-call style Haskell interface to the client does not scale well because calling a Javascript command involves sending the command, and optionally waiting for a response, over a network. Instead, we build a deep embedding of Javascript commands inside a Javascript monad. Along with supporting web-based infrastructure, we deliver entire program fragments to our web-based applications. Using our monad, the Haskell programmer can choose the granularity of interaction, with the option of having reactive interfaces that are completely handled by the client.


  author = {Andrew Farmer and Andy Gill},
  title = {Haskell {DSL}s for Interactive Web Services},
  booktitle = {1st International Workshop on Cross-model Language Design and Implementation},
  location = {Copenhagen, Denmark},
  year = {2012},
  month = {Sep},