| Safe Haskell | None |
|---|
Language.Nomyx.Expression
Contents
Description
This module containt the type definitions necessary to build a Nomic rule.
- type PlayerNumber = Int
- type PlayerName = String
- type RuleNumber = Int
- type RuleName = String
- type RuleDesc = String
- type RuleText = String
- type RuleCode = String
- type EventNumber = Int
- type EventName = String
- type VarName = String
- type Code = String
- type OutputNumber = Int
- data Nomex a where
- NewVar :: (Typeable a, Show a, Eq a) => VarName -> a -> Nomex (Maybe (V a))
- ReadVar :: (Typeable a, Show a, Eq a) => V a -> Nomex (Maybe a)
- WriteVar :: (Typeable a, Show a, Eq a) => V a -> a -> Nomex Bool
- DelVar :: V a -> Nomex Bool
- OnEvent :: (Typeable e, Show e, Eq e) => Event e -> ((EventNumber, EventData e) -> Nomex ()) -> Nomex EventNumber
- DelEvent :: EventNumber -> Nomex Bool
- DelAllEvents :: (Typeable e, Show e, Eq e) => Event e -> Nomex ()
- SendMessage :: (Typeable a, Show a, Eq a) => Event (Message a) -> a -> Nomex ()
- ProposeRule :: Rule -> Nomex Bool
- ActivateRule :: RuleNumber -> Nomex Bool
- RejectRule :: RuleNumber -> Nomex Bool
- AddRule :: Rule -> Nomex Bool
- ModifyRule :: RuleNumber -> Rule -> Nomex Bool
- GetRules :: Nomex [Rule]
- GetPlayers :: Nomex [PlayerInfo]
- SetPlayerName :: PlayerNumber -> PlayerName -> Nomex Bool
- DelPlayer :: PlayerNumber -> Nomex Bool
- NewOutput :: Maybe PlayerNumber -> String -> Nomex OutputNumber
- GetOutput :: OutputNumber -> Nomex (Maybe String)
- UpdateOutput :: OutputNumber -> String -> Nomex Bool
- DelOutput :: OutputNumber -> Nomex Bool
- SetVictory :: [PlayerNumber] -> Nomex ()
- CurrentTime :: Nomex UTCTime
- SelfRuleNumber :: Nomex RuleNumber
- Return :: a -> Nomex a
- Bind :: Nomex a -> (a -> Nomex b) -> Nomex b
- ThrowError :: String -> Nomex a
- CatchError :: Nomex a -> (String -> Nomex a) -> Nomex a
- data V a = V {}
- data Player
- data RuleEvent
- data Time
- data EvRule
- data Message m
- data Victory
- data Input a = Input PlayerNumber String (InputForm a)
- data InputForm a
- data Event a where
- data InputData a
- = RadioData a
- | CheckboxData [a]
- | TextData String
- | TextAreaData String
- | ButtonData
- data EventData a where
- PlayerData :: { } -> EventData Player
- RuleData :: { } -> EventData RuleEvent
- TimeData :: { } -> EventData Time
- MessageData :: Show m => {
- messageData :: m
- InputData :: Show a => { } -> EventData (Input a)
- VictoryData :: {
- victoryData :: [PlayerInfo]
- type Msg a = Event (Message a)
- type MsgData a = EventData (Message a)
- type RuleFunc = Nomex RuleResp
- data RuleResp
- data BoolResp
- data Rule = Rule {}
- data RuleStatus
- data PlayerInfo = PlayerInfo {}
- partial :: String -> Nomex (Maybe a) -> Nomex a
- playerName :: Lens PlayerInfo String
- playerNumber :: Lens PlayerInfo PlayerNumber
- rAssessedBy :: Lens Rule (Maybe RuleNumber)
- rStatus :: Lens Rule RuleStatus
- rRuleFunc :: Lens Rule RuleFunc
- rRuleCode :: Lens Rule Code
- rProposedBy :: Lens Rule PlayerNumber
- rDescription :: Lens Rule String
- rName :: Lens Rule RuleName
- rNumber :: Lens Rule RuleNumber
Documentation
type PlayerNumber = IntSource
type PlayerName = StringSource
type RuleNumber = IntSource
type EventNumber = IntSource
type OutputNumber = IntSource
Nomyx Expression
A Nomex (Nomyx Expression) allows the players to write rules. within the rules, you can access and modify the state of the game.
Constructors
Variables
a container for a variable name and type
Events
events types
Constructors
| Input PlayerNumber String (InputForm a) |
events names
Constructors
| RadioData a | |
| CheckboxData [a] | |
| TextData String | |
| TextAreaData String | |
| ButtonData |
data associated with each events
Constructors
| PlayerData :: PlayerInfo -> EventData Player | |
Fields | |
| RuleData :: Rule -> EventData RuleEvent | |
| TimeData :: UTCTime -> EventData Time | |
| MessageData :: Show m => m -> EventData (Message m) | |
Fields
| |
| InputData :: Show a => InputData a -> EventData (Input a) | |
| VictoryData :: [PlayerInfo] -> EventData Victory | |
Fields
| |
Rule
Return type of a rule function. it can be either nothing or another rule.
An informationnal structure about a rule
Constructors
| Rule | |
Fields
| |