
18 Mar
2009
18 Mar
'09
10:21 a.m.
Colin Paul Adams wrote:
The code of the following routine is intended to indicate how long it takes for the computer to make a move. However the time is printed (as very close to zero) long before the move is made.
You are writing a thunk to the IORef. It only gets computed later on when you read the value. Try using:
readIORef game_state_ior >>= evaluate . update_interactive_from_move move >>= writeIORef game_state_ior
evaluate is in Control.Exception. -Yitz