wamserma Added runhaskell-script for Windows
A Windows-CMD-port of the runhaskell bash-script. Tested with stack.
Latest commit 27feebc Nov 22, 2017
Permalink
..
Failed to load latest commit information.
Data/List Move extra source files for the examples to the right directory. Oct 2, 2013
static Maintenance: Retire some examples, in particular `UseWords.hs` and `M… May 3, 2015
BarTab.hs fixed BarTab.hs example: UI.text instead of text Sep 6, 2015
Buttons.hs Convert `Graphics.UI.Threepenny.Core` to use the new `Foreign.JavaScr… Oct 9, 2014
CRUD.hs Change default port number to 8023. #64 Feb 24, 2014
Canvas.hs Export `loadFile` and `loadDirectory` in `UI` monad. Apr 9, 2017
Chat.hs Add ‘jsCallBufferMode’ option to server ‘Config’. #163 Aug 26, 2017
CurrencyConverter.hs Change default port number to 8023. #64 Feb 24, 2014
DragNDropExample.hs Fix `Graphics.UI.Threepenny.Internal.Core.delete` to also detach the … Oct 10, 2014
DrumMachine.hs Maintenance: Fis grammar and spelling mistakes May 2, 2016
FadeInFadeOut.hs Change default port number to 8023. #64 Dec 26, 2013
GetElementsBy.hs Implement exceptions for `callFunction`. #129 Dec 7, 2016
Mouse.hs Change default port number to 8023. #64 Feb 24, 2014
Paths.hs Maintenance: Static resources for code examples are now in the `sampl… May 3, 2015
README.md Documentation: Add example of event registration without browser resp… Dec 2, 2016
Svg.hs New function `mkElementNamespace` allows the creation of elements wit… Oct 10, 2014
TestExceptions.hs Improve printing of pure exceptions #145 Mar 27, 2017
TestSpeed.hs Test whether batching FFI calls may help: Yes. #131 Dec 10, 2016
TestURLFragments.hs Ignore URL fragments when connecting to websocket. #128 Dec 8, 2016
WorkaroundFastEvent.hs Documentation: Add example of event registration without browser resp… Dec 2, 2016
ghci Maintenance: Make local ‘ghci’ scripts compatible again Aug 13, 2017
runhaskell Maintenance: Make local ‘ghci’ scripts compatible again Aug 13, 2017
runhaskell.cmd Added runhaskell-script for Windows Nov 22, 2017

README.md

Examples

This folder contains the code examples for the Threepenny GUI library.

To run the examples, you can (but don't have to) use the provided runhaskell and ghci scripts:

cd samples
./runhaskell Chat.hs

These scripts check whether you have set up a cabal sandbox or, alternatively, the stack utility for use with this library, and uses these instead of the global package database; this is very useful for me as a library author.

(To set up the examples with stack, do the following

git clone https://github.com/HeinrichApfelmus/threepenny-gui.git
cd threepenny-gui/
stack init
stack setup
stack build
cd samples
./runhaskell Mouse.hs

)

After you have started an example, open your web browser and point it to the address http://localhost:8023. Enjoy!

Here a description of the currently maintained examples.

There are also a few other examples that are used for testing or that demonstrate library internals. They won't be maintained.

  • WorkaroundFastEvent.hs — Demonstrates how to register an event handler without requiring a response from the browser window.