[Haskell-cafe] Nomic game in Haskell
corentin.dupont at gmail.com
Wed Apr 14 15:14:18 EDT 2010
do you know Nomic?
It's a fabulous and strange game where you have the right to change the
rules in the middle of the game!
In fact, changing the rules is the goal of the game. Changing a rule is
considered as a move.
Of course even that could be changed!
I'm wondering if it could be possible to implement a Nomic (or an helper for
the game) in Haskell.
Haskell seems appropriate for that, since functions are first order objects,
and Haskell is good at DSLs.
What I think, is creating a DSL where a rule could be expressed as a
function, or a monad.
Many kinds of rules could be expressed:
1. - a rule that says that player #1 must be named Grand Counselor.
2. - a rule that says that the following rules must be voted at the
majority, and how.
3. - a rule that says that the money is the ECU.
4. - a rule that says that if a rule is accepted, the author is awarded 1
5. - a rule that says that all rules must have a name.
6. - a rule that says that democracy is abolished. God save the King, Player
7. - a rule that says that a rule mustn't suppress another.
As you can see, the rules are highly self-referencing!
some rules, like #1, describes a protocol, involving IO (players voting).
some rules, like #7, could be implemented with a test over new rules (that
rule could test proposed rules against rule suppression).
some rules, like #5, must inspect the code of other rules.
A proposed rule must pass all active rule's criterias to become active.
Once active, a rule should be applyed immediatly to all active rules, and to
all futur rules, until it is repealed.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe