canvashs-0.1

Safe HaskellNone

CanvasHs

Description

The CanvasHS module allows haskell programmers to easily create graphical programs using event diven IO. Using the installEventHandler function the user can register an event handler which will process incoming events and with the current state in mind, will result in a new state and output, which could be graphical, actions (IO, timers and others) or both.

Synopsis

Documentation

installEventHandler

Arguments

:: Callback userState

event handler on current state and incoming event, that produces a tuple of the new user state and ouput to process: (userState -> Event -> (userState, Output))

-> userState

start state

-> IO () 

Registers an event handler and starts CanvasHs. This will start the needed servers (weboscket and http) and will open a browser window.

shape :: Shape -> Output

convenience function to create an Output of just a Shape

actions :: [Action] -> Output

convenience function to create an Output of just a list of Actions