Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>When you say "real world" examples you are presumably thinking about problems that are inherently sequential or stateful or do lots of I/O, right?</p> <p>So, how about games?</p> <ul> <li><a href="http://Haskell.Org/haskellwiki/Frag" rel="noreferrer">Frag</a> is a Quake clone, implemented for an undergraduate thesis (<a href="http://WWW.CSE.UNSW.Edu.Au/~pls/thesis/munc-thesis.pdf" rel="noreferrer">Functional Programming and 3D Games, Mun Hon Cheong, 2005</a>). <a href="http://www.youtube.com/watch?v=0jYdu2u8gAU" rel="noreferrer">Here's a video of it in action</a>.</li> <li><a href="https://GitHub.Com/Mokehehe/Monao/" rel="noreferrer">Super Monao Bros.</a> (formerly known as <em>Super Nario Bros.</em>) is, well, you can probably figure out which game it is a clone of. (<a href="http://Mokehehe.BlogSpot.Com/" rel="noreferrer">This is the author's English language weblog.</a>)</li> <li><a href="http://Prog21.Dadgum.Com/23.html" rel="noreferrer">Purely Functional Retrogames</a> is a 4-part series of blog articles about how to write games in a purely functional language, explained using Pacman as the example. (<a href="http://Prog21.Dadgum.Com/24.html" rel="noreferrer">Part 2</a>, <a href="http://Prog21.Dadgum.Com/25.html" rel="noreferrer">Part 3</a>, <a href="http://Prog21.Dadgum.Com/26.html" rel="noreferrer">Part 4</a>.)</li> </ul> <p>Or, what about an <a href="http://XMonad.Org/" rel="noreferrer">X Window Manager</a>, an extensible <a href="http://Haskell.Org/haskellwiki/Yi" rel="noreferrer">Emacs clone text editor</a> or an <a href="http://Leksah.Org/" rel="noreferrer">IDE</a>?</p> <p>Then, there is the book, which even has your question already in the title: <a href="http://Book.RealWorldHaskell.Org/" rel="noreferrer">Real World Haskell</a> <em>and</em> which is also <a href="http://Book.RealWorldHaskell.Org/read/" rel="noreferrer">available for free</a>!</p> <p>Another thing you might want to look at, is <a href="http://Google.Com/search?q=Functional+Reactive+Programming" rel="noreferrer">Functional Reactive Programming</a>. (It is used in Frag, for example.) The interesting thing about FRP is that it allows you to look at the problem of, say, GUI programming from a very different angle. If you read the GUI chapter in the RWH book, you will see that it talks about how you can write a GUI application just like in C, only better. FRP OTOH allows you to write it in a <em>totally different</em> way that wouldn't even be <em>possible</em> in C.</p> <p>A lot of times (I'm not saying that this is the case in your question, but it is a recurring pattern) when someone says "but can Haskell be used in the real world", what they are <em>really</em> saying is "I know how to do this in C, and in Haskell I cannot do it in exactly the same way, therefore it must be impossible in Haskell, therefore Haskell is not ready for the real world". But what they are missing out on, is that there might be a totally different and <em>much better</em> way to solve the problem. (It's like saying "Erlang doesn't have threads, therefore it cannot possibly be used to implement concurrent systems.") And FRP is just one example.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload