Hugh wrote:
1)Bloody hell,if I get into the mindset of a functional language I'll have to think in a completely different way than I do with c++.
That isn't a bad thing.
Quote:
Q) Is that going to upset my c++ programming,confusing and confounding myself.
It will probably change the way you write your c++ code, but it will be for the better. My c code changed a lot as a result of learning Haskell, and even though I rarely use it now, it improved my coding in other languages.
Quote:
3)I doubt Haskell is used to make games
First person shooter in haskell:
http://www.haskell.org/haskellwiki/FragQuote:
if I type % ghc --make Main.hs -o main.exe
into the glasgow haskell compiler interactive nothing happens.
Type it into the command prompt (ie, not ghci)
The thing you have to get drilled into your head with Haskell is that all your state must be explicit. To make a game, you have an object representing the game, and an object representing the players commands, and a function which takes the old state, the commands and spits out a new state (oh, and probably another function which displays the state).
You can't mix things up like you can in an imperative language - for example, code which said "if the left arrow is down then move the player to the left" should be split up between the different abstractions - the left arrow key being down shouldn't directly change where the player is, only the function that creates a new game state based on the old state and some input gets to move where the player is (and when I say "move", I really mean "create a new version of the world, where the player is to the left").
Stick with it though, you'll be a better person for it.