From HaskellWiki
Revision as of 22:47, 22 December 2007 by PhilippaCowderoy (talk | contribs)

Jump to: navigation, search


Frag is a 3D first person shooting game written in Haskell, by Mun Hon Cheong. It is licensed under the GPL. The design and implementation of Frag is described in Mun's undergraduate thesis, Functional Programming and 3D Games.


  • Yampa, a domain-specific embedded language for the programming of hybrid systems that using the concepts of Functional Reactive Programming (FRP) was used to program the game entities.
  • The Quake 3 BSP level format, Q3Map2, and the MD3 format for models and animations are used in this game.
  • Sven Panne's OpenGL binding, HOpenGL is used to render graphics.


  • GHC 6.4 or greater, providing HOpenGL-2.0.
  • OpenGL drivers that support the vertex array and multitexture OpenGL extensions


The code is distributed via a darcs repository: darcs get

darcs is the standard rcs of the Haskell community.


Frag needs contributions from the community! Darcs send patches to Don Stewart.

Update: 2007, there are reports of crashes on 64 bit machines. If you have access to a 64 bit machine, with a recent OpenGL, please do consider checking the FFI bindings for 64 bit cleanliness. 32 bit machines appear to be fine.

Update: The IO code makes assumptions about the size of CInt et al, this may well be the source of the crashes







BibTeX Entry

    author   = {Mun Hon Cheong},
    title    = {Functional Programming and 3D Games},
    year     = {2005},
    month    = {November},
    school   = {University of New South Wales},
    address  = {Sydney, Australia},
    abstract = {Games are commonly programmed in imperative languages.
                Functional languages have been known to have benefits but have
                rarely been used to program games. In this thesis we implement
                a first person shooting game in Haskell and Yampa. The merits
                of this approach are examined.}