Nomyx-Language-0.2.1: Language to express rules for Nomic

Safe HaskellNone

Language.Nomyx.Expression

Contents

Description

This module containt the type definitions necessary to build a Nomic rule.

Synopsis

Documentation

Nomyx Expression

data Nomex a whereSource

A Nomex (Nomyx Expression) allows the players to write rules. | within the rules, you can access and modify the state of the game. | It is a compositional algebra defined with a GADT.

Variables

data V a Source

a container for a variable name and type

Constructors

V 

Fields

varName :: String
 

Instances

data Var Source

stores the variable's data

Constructors

forall a . (Typeable a, Show a, Eq a) => Var 

Fields

_vRuleNumber :: Int
 
_vName :: String
 
vData :: a
 

Instances

type Id a = aSource

Events

data Player Source

events types

Constructors

Arrive 
Leave 

data Time Source

Instances

data Message m Source

Instances

data Event a whereSource

events names

Instances

Typeable1 Event 
Eq e => Eq (Event e) 
Show a => Show (Event a) 

data EventData a whereSource

data associated with each events

Instances

type Msg a = Event (Message a)Source

Rule

type RuleFunc = Nomex RuleRespSource

Type of a rule function.

data RuleResp Source

Return type of a rule function. it can be either nothing or another rule.

Constructors

Void 
Meta (Rule -> Nomex BoolResp) 

data BoolResp Source

Constructors

BoolResp Bool 
MsgResp (Msg Bool) 

Instances

data RuleStatus Source

the status of a rule.

Constructors

Active 
Pending 
Reject 

Player

Game

data Game Source

The state of the game: