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

Safe HaskellNone
LanguageHaskell98

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 Effect Source

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 NoEffect Source

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

data Exp :: Eff -> * -> * where Source

Instances

Variables

data V a Source

a container for a variable name and type

Constructors

V 

Fields

varName :: String
 

Instances

Typeable (* -> *) V 

Events

data Event a where Source

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 
BindEvent :: Event a -> (a -> Event b) -> Event b 
ShortcutEvents :: [Event a] -> ([Maybe a] -> Bool) -> Event [Maybe a] 
BaseEvent :: Typeable a => Field a -> Event a 
LiftNomexNE :: NomexNE a -> Event a 

data Field a where Source

Base events

Instances

Eq (Field e) 
Show (Field a) 
Typeable (* -> *) Field 

data SomeField Source

Type agnostic base event

Constructors

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

Instances

data SomeData Source

Type agnostic result data

Constructors

forall e . (Typeable e, Show e) => SomeData e 

Instances

data Player Source

Events parameters

Constructors

Arrive 
Leave 

data Msg m Source

Constructors

Msg String 

Instances

Eq (Msg e) 
Show (Msg m) 
Typeable (* -> *) Msg 

data InputForm a where Source

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] 

Instances

data FieldResult Source

Constructors

forall e . (Typeable e, Show e) => FieldResult 

Instances

type EventHandler e = (EventNumber, e) -> Nomex () Source

data Status Source

Constructors

SActive 
SDeleted 

Instances

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