Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which event-driven applications are implemented in Haskell?

I've been looking at Haskell lately and it seems like a very nice way to watch programming problems from an alternative point of view - alternative to my usual imperative (I have a strong C++ background) view, at least.

However, all the articles I see seem to deal with the same kinds of programming problems:

  • Parsers
  • Compilers
  • Numeric computation problems

I'd like to give Haskell a try myself, by writing some GUI application. Hence, I'm wondering: does it make sense to write event-driven systems like GUIs in a functional programming language like Haskell? Or is that a problem domain at which imperative languages excel? Unfortunately it still takes quite some time for me to switch my mind to 'functional' mode, so I have a hard time deciding argueing against or in favor of using a functional programming language for an event-driven system.

I'd also be interested in examples of GUI applications (or event-driven systems, in general) which are implemented in Haskell.

like image 311
Frerich Raabe Avatar asked Jan 17 '10 23:01

Frerich Raabe


4 Answers

Here's a couple of Google keywords for you:

  • Functional Reactive Programming (FRP), a programming paradigm for, well reactive (aka event-driven) programming in purely functional languages,
  • Leksah, a Haskell IDE written in Haskell,
  • Yi, an Emacs-like editor which replaces Lisp with Haskell as the implementation, configuration, customization and scripting language,
  • Super Monao Bros. (yes, you guessed it, a Jump&Run game)
  • Frag (First-Person Shooter)
  • Purely Functional Retrogames is a 4-part series of blog articles about how to write games in a purely functional language, explained using Pacman as the example. (Part 2, Part 3, Part 4.)
like image 93
Jörg W Mittag Avatar answered Nov 18 '22 00:11

Jörg W Mittag


xmonad is an X11 window manager written in Haskell.

Also, looking at how the various Haskell GUI Libraries are implemented may give some ideas of how interactive programs are made in Haskell.

like image 45
Justin Smith Avatar answered Nov 17 '22 23:11

Justin Smith


Here's an example using epoll to implement an event driven web server: http://haskell.org/haskellwiki/Simple_Servers

like image 4
Don Stewart Avatar answered Nov 18 '22 00:11

Don Stewart


Take a look at this wikibooks article, it's a basic wxHaskell tutorial. In particular see the Events section.

I recommend spending some quality time with Haskell and FP in general before jumping in to develop a fully-fledged application so you can get more familiarized with Haskell, since it's quite different from C++

like image 3
Mauricio Scheffer Avatar answered Nov 17 '22 23:11

Mauricio Scheffer