[Haskell-cafe] Is this related to continuations somehow?

Andrew Wagner wagner.andrew at gmail.com
Thu Feb 12 21:34:34 EST 2009


So, I was reading a bit about continuations the other day, and, since I've
been thinking about good ways of expressing chess strategies in Haskell, I
thought that I'd play around a bit with something like continuations for
game-playing strategies. The idea is that you have combinators that allow
you full access to the strategies which remain to be applied. In this way,
strategies can "activate" and "de-activate" other strategies. Here's a
simple little toy app for Tic-Tac-Toe (Naughts and Crosses):

http://codepad.org/nN9JsxFK

You can run main on 'example', and see that it searches every line and
fails. And, as you can see, it aborts after finding a win in example2. This
would be easily extensible to say things like "if you've seen a blocking
move, and you don't have a win, then play the blocking move", and of course
the other deep intricacies of the game.

My question is, is this, in fact, related to continuations somehow? Could
continuations simplify it? Or am I doing something completely different?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090212/d6824646/attachment.htm


More information about the Haskell-Cafe mailing list