2019-12-09 12:22
Page 1

Graphical User Interfaces in Haskell

Thomas Hallgren, December 2019

Page 2

Functional Programming and Graphical User Interfaces

Why am I talking about this?

A long time ago a colleague I created Fudgets.

Page 3

Graphical User Interface Libraries

Several libraries for Graphics and GUIs can be found on Hackage:

Page 4

Today: threepenny-gui

Page 5

First: HTML and JavaScript

Page 6

HTML – T is for Text

Page 7

HTML – Markup and hyperlinks

Page 8

Making web pages more dynamic

Page 9

JavaScript Example

Page 10

User interface elements

Page 11

Adding functionality: event handlers

Adding an event handler for the button

Page 12

threepenny-gui

Page 13

threepeny-gui programming example

Page 14

Elements and attributes

Example

Page 15

Event handlers

Counter Example

Page 16

Drawing on a canvas

Page 17

State handling and mutable variables

Page 18

GUI programming in a functional style?

Page 19

GUI programming in a functional style

Page 20

Haste

Page 21

For reference