Gloss
- A Haskell library for simple 2D graphics and animations
- Implemented using OpenGL (but you don’t need to know this)
- Hides complexity under a few simple datatypes and display functions
- Declarative: express what you want to draw, not how to draw it
- Designed for teaching
References
- Home page
http://gloss.ouroborus.net/
- Hackage
http://hackage.haskell.org/package/gloss
Examples
Assignment
Implement a mini-library for visualizing data structures e.g. binary search trees:

Objectives
- Implement a visualization function
- Read numbers from stdin, construct and display the tree
- Animate each insertion step-by-step (use Gloss’
simulate
)
Extra:
- Implement self-balancing trees (e.g. AVL trees)
Rules
- The assignment should be done individually
- Practical lab class on the 9th March
- Turn in until the 27rd March
- Please submit a tar.gz archive
- exclude binaries and temporary
.o
, .hi
files
- Document any functions and types you define
Assement
- Valued aspects:
- data models (types)
- decomposition into simple functions
- modularity, easy of reuse and extension
- Quality over quantity
Plagiarism
- You may discuss ideas, sketches and diagrams with other students
- But: don’t share or even look at each other’s code!
- If you take ideas from external sources (internet, books, etc.) include references in source comments
- If you use GitHub/Gitlab: make your repository private
- Blatant plagiarism will cause all your assignments to be disqualified