[Haskell] Animal guessing game - critique my code
Sebastian Sylvan
sylvan at student.chalmers.se
Sat Oct 28 20:16:46 EDT 2006
On 10/29/06, JTXX <jtxx000 at yahoo.co.uk> wrote:
> Hello everybody.
>
> I'm trying to learn Haskell, and so I implemented the
> classic animal guessing game. However, I feel that
> there is probably a more elegant implementation than
> the one shown below, so any suggestions for
> improvement would be great.
>
All of your code lives in the IO monad. It's usually considered a good
idea to split your program into "IO" and "logic". Do as much as
possible outside of the IO monad (i.e. in functions which don't have
an IO type).
--
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862
More information about the Haskell
mailing list