I'm trying to write my first Haskell program. The below is the first real
logic block I've tried to write, unfortunately I get a "The last statement
in a 'do' construct must be an expression" error when loading the method.
However, the location of this problem isn't very clear. Is there a way to
get more detailed parse message from Haskell, or can someone tell me where
the problem is (and better "why"?). I don't think I actually need to use a
"do" IO/Monad theme here, but its not clear to me either way. This isn't
homework, its just for fun...
do_solve_iter guess tried = do
let actual = count_occurences guess
if guess == actual
then putStrLn "ANSWER!!"
else if (find (==actual) tried) == Just actual
putStrLn "NO ANSWER!"
do_solve_iter actual (actual : tried)
View this message in context:
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
Haskell-Cafe mailing list