free-game- Cross-platform GUI library based on free monads

MaintainerFumiaki Kinoshita <>
Safe HaskellNone




This module just re-exports other submodules.



type Game = F GUISource

Game is a free monad which describes GUIs. This monad is an instance of Picture2D so you can construct it using fromBitmap and can be transformed with translate, scale, rotate, colored.

It is also an instance of Keyboard and Mouse. Note that mousePosition returns a relative position. For example:

 foo = foreverTick $ do
   p <- mousePosition
   translate p $ colored blue $ polygonOutline [V2 (-8) (-8), V2 8 (-8), V2 8 8, V2 (-8) 8]

When we run foo using runGame, a blue square follows the cursor. And translate (V2 240 240) foo, rotate 45 foo, scale 1.5 foo also does in the same way.

You have to call tick at the end of the frame.

The only way to embody a Game as a real stuff is to apply runGame.

for more examples, see

runGame :: GUIParam -> Game a -> IO (Maybe a)Source

Run a Game.

def :: Default a => a

The default value for this type.


module Data.Color

module Linear