Monthly Downloads: 1
Programming language: Haskell
License: MIT License
Tags: Graphics     Fltkhs     UI    

fltkhs-demos alternatives and similar packages

Based on the "fltkhs" category.
Alternatively, view fltkhs-demos alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of fltkhs-demos or a related project?

Add another 'fltkhs' Package



These are end-to-end demos of FLTKHS, a Haskell Binding to the FLTK GUI Library

Fltkhs-demos aims not only to show off the features of the FLTKHS but also serve as a way of learning the API by example. For more thorough documentation on the FLTKHS API please see the FLTKHS module of that package.


FLTKHS now bundles the FLTK source so all you need to do is:

> git clone http://github.com/deech/fltkhs-demos
> stack install --flag fltkhs:bundled
> stack exec fltkhs-arc

Learning The API

Most of the demos are exact ports of those shipped in the 'test' directory of the distribution. It is hoped the user will study the Haskell demo code side-by-side with the C++ demo code in order to understand the API. The section API Guide in the FLKTHS documentation covers this in more detail.

Why is the demo code so un-Haskelly?

For being written in Haskell, the demo code is horrifyingly/amazingly imperative and stateful. Although it may repulse those who used to pure Haskell idioms it is that way for a reason.

The demo code was never meant to be idiomatic Haskell code but a way of showing as much of the API as possible. The API itself closely resembles the underlying C++ code which is imperative and stateful. This has the advantage of making the API easier to learn.

For instance, assuming FLTK was installed from source compare /src/Examples/arc.hs with /test/arc.cxx in the FLTK source directory. There is quite a bit of correspondence and it is easy to see how the Haskell API functions map to the C++ ones.

Fast Compilation Flag

This package comes with a flag fastCompile that is enabled by default and speeds up compilation. More information on this flag is available under the Compilation section of the FLTKHS documentation.

To disable this flag, tell Stack to ignore it during the configure step:

stack build --flag fltkhs-demos:-fastCompile --flag fltkhs:bundled


Please see "Running In The Repl" 5 section of the FLTKHS documentation for more information.