threepenny-gui: GUI framework that uses the web browser as a display.

[ bsd3, gui, library, web ] [ Propose Tags ]

Threepenny-GUI is a GUI framework that uses the web browser as a display.

It's cheap and easy to install because everyone has a web browser installed.

Internally, the library implements a small web server that serves a HTML/JavaScript page with the GUI elements. You can freely manipulate the HTML DOM and handle browser events from your Haskell code.

Stability forecast: This is an experimental release! Send us your feedback! Significant API changes are likely in future versions.

NOTE: This library contains examples, but they are not built by default. To build and install the example, use the buildExamples flag like this

cabal install threepenny-gui -fbuildExamples

[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
buildexamples

Build example executables.

Disabled
network-uri

Get Network.URI from the network-uri package

Enabled
rebug

The library uses some techniques that are highly non-deterministic, for example garbage collection and concurrency. Bugs in these subsystems are harder to find. Activating this flag will expose more of them.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.2.0.1, 0.3.0.0, 0.3.0.1, 0.4.0.0, 0.4.0.1, 0.4.0.2, 0.4.1.0, 0.4.2.0, 0.5.0.0, 0.6.0.1, 0.6.0.2, 0.6.0.3, 0.6.0.4, 0.6.0.5, 0.6.0.6, 0.7.0.0, 0.7.0.1, 0.7.0.2, 0.8.0.0, 0.8.0.1, 0.8.1.0, 0.8.2.0, 0.8.2.1, 0.8.2.2, 0.8.2.3, 0.8.2.4, 0.8.3.0, 0.8.3.1, 0.8.3.2, 0.9.0.0, 0.9.1.0, 0.9.2.0, 0.9.3.0, 0.9.4.0, 0.9.4.1 (info)
Change log CHANGELOG.md
Dependencies aeson (>=0.6 && <0.9), attoparsec-enumerator (>=0.3 && <0.4), base (>=4 && <5), bytestring (>=0.9.2 && <0.11), containers (>=0.4.2 && <0.6), data-default (>=0.5 && <0.6), deepseq (>=1.3 && <1.4), filepath (>=1.3 && <1.4), hashable (>=1.1.0 && <1.3), MonadCatchIO-transformers (>=0.3 && <0.4), network (>=2.3.0 && <2.6), network-uri (>=2.6 && <2.7), parsec, safe (>=0.3 && <0.4), snap-core (>=0.9 && <0.10), snap-server (>=0.9 && <0.10), stm (>=2.3 && <2.5), template-haskell (>=2.7.0 && <2.10), text (>=0.11 && <1.3), threepenny-gui, time (>=1.4 && <1.5), transformers (>=0.3.0 && <0.5), unordered-containers (>=0.2 && <0.3), utf8-string (>=0.3 && <0.4), vault (>=0.3 && <0.4), websockets (>=0.8 && <0.10), websockets-snap (>=0.8 && <0.10) [details]
License BSD-3-Clause
Author Chris Done, Heinrich Apfelmus
Maintainer Heinrich Apfelmus <apfelmus at quantentunnel dot de>
Category Web, GUI
Home page http://www.haskell.org/haskellwiki/Threepenny-gui
Bug tracker https://github.com/HeinrichApfelmus/threepenny-gui/issues
Source repo head: git clone git://github.com/HeinrichApfelmus/threepenny-gui.git
Uploaded by HeinrichApfelmus at 2014-10-04T08:54:46Z
Distributions LTSHaskell:0.9.4.1, NixOS:0.9.4.1, Stackage:0.9.4.1
Reverse Dependencies 8 direct, 3 indirect [details]
Executables threepenny-examples-use-words, threepenny-examples-missing-dollars, threepenny-examples-drummachine, threepenny-examples-dragndropexample, threepenny-examples-currencyconverter, threepenny-examples-crud, threepenny-examples-chat, threepenny-examples-buttons, threepenny-examples-bartab
Downloads 31555 total (239 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for threepenny-gui-0.5.0.0

[back to package description]

Build Status

Threepenny-gui is a GUI framework written in Haskell that uses the web browser as a display. It's very easy to install. See the

Project homepage

for more information on what it does and can do for you as a library user.

Examples

The library comes with many examples, which can be found in the samples folder. Follow the link for more information on how to run them.

Technical overview

Latency

The frequent communication between browser and server means that Threepenny is best used as a GUI server running on localhost.

The communication is done over a persistent connection using WebSockets.

If you want to reduce latency, the best option is to generate JavaScript code and run it on the client. Consider this approach similar to a shading language.. Some means of producing JavaScript from Haskell might be:

  • Fay
  • HJScript
  • GHCJS
  • UHC

Alternatively, the JS can be written by the user directly and invoked via the JavaScript FFI from Threepenny.

Future ideas

HTML rendering mode

It might be nice in the case of search engines to merely generate a DOM and render it, so that search engines can read the pages.

UI libraries

qooxdoo — provides a feature-complete widget set. One could wrap this in a type-safe API from Threepenny and get a complete, stable UI framework for free. Most of the "immediate feedback" like dragging things here, switching tabs there, are taken care of by the framework. All that would be left would be to provide the domain configuration and business/presentation logic.

There are plenty more like this, but this is the first that springs to mind that is good.

Contributors

Many thanks to everyone who contributed, provided feedback or simply wrote an application using Threepenny!

  • Heinrich Apfelmus
  • Daniel Austin
  • Daniel Díaz
  • Yuval Langer
  • Ken Friis Larsen
  • Daniel Mlot
  • JP Moresmau
  • Luke Palmer
  • Jens Petersen
  • rnons
  • Michael Snoyman
  • Steve Bigham
  • tailcalled

Special thanks to Chris Done for starting the precursor project Ji.