Nomyx-Language-0.6.0: 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 Eff Source

Constructors

Effect 
NoEffect 

type Nomex = Exp EffectSource

A Nomex (Nomyx Expression) allows the players to write rules. within the rules, you can access and modify the state of the game.

type NomexNE = Exp NoEffectSource

A NomexNE (Nomyx Expression No Effect) is a specialisation of the type that guaranties that the instructions will have no effects.

data Exp whereSource

Variables

data V a Source

a container for a variable name and type

Constructors

V 

Fields

varName :: String
 

Instances

Events

data Event a whereSource

Composable events

Constructors

SumEvent :: Event a -> Event a -> Event a 
AppEvent :: Event (a -> b) -> Event a -> Event b 
PureEvent :: a -> Event a 
EmptyEvent :: Event a 
BaseEvent :: Typeable a => Field a -> Event a 

data Field a whereSource

Base events

Instances

data SomeField Source

Type agnostic base event

Constructors

forall a . Typeable a => SomeField (Field a) 

Instances

data Player Source

Events parameters

Constructors

Arrive 
Leave 

data Msg m Source

Constructors

Msg String 

Instances

Typeable1 Msg 
Eq (Msg e) 
Show (Msg m) 

data InputForm a whereSource

Input forms

Constructors

Text :: InputForm String 
TextArea :: InputForm String 
Button :: InputForm () 
Radio :: (Show a, Eq a) => [(a, String)] -> InputForm a 
Checkbox :: (Show a, Eq a) => [(a, String)] -> InputForm [a] 

Rule

type Rule = Nomex ()Source

Type of a rule function.

data RuleStatus Source

the status of a rule.

Constructors

Active 
Pending 
Reject 

Player

Victory

concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]Source