[Haskell-cafe] Re: Nomic game in Haskell

Dan Piponi dpiponi at gmail.com
Thu Apr 15 20:39:16 EDT 2010


On Thu, Apr 15, 2010 at 4:58 PM, Ashley Yakeley <ashley at semantic.org> wrote:

> type Board a b c d e f g h i =
>  Either (Three a b c)
>  (Either (Three d e f)
>  (Either (Three g h i)
>  (Either (Three a d g)
>  (Either (Three b e h)
>  (Either (Three c f i)
>  (Either (Three a e i)
>  (Either (Three c e g)
>  )))))))

In the service of readability we could also define:

data X = X
data O

Though the victory conditions aren't precisely the usual ones.
--
Dan


More information about the Haskell-Cafe mailing list