Safe Haskell | None |
---|
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
- type InputNumber = Int
- data Eff
- type Effect = Effect
- type NoEffect = NoEffect
- type Nomex = Exp Effect
- type NomexNE = Exp NoEffect
- data Exp where
- NewVar :: (Typeable a, Show a) => VarName -> a -> Nomex (Maybe (V a))
- ReadVar :: (Typeable a, Show a) => V a -> NomexNE (Maybe a)
- WriteVar :: (Typeable a, Show a) => V a -> a -> Nomex Bool
- DelVar :: V a -> Nomex Bool
- OnEvent :: (Typeable e, Show e) => Event e -> ((EventNumber, e) -> Nomex ()) -> Nomex EventNumber
- DelEvent :: EventNumber -> Nomex Bool
- SendMessage :: (Typeable a, Show a) => Msg a -> a -> Nomex ()
- ProposeRule :: RuleInfo -> Nomex Bool
- ActivateRule :: RuleNumber -> Nomex Bool
- RejectRule :: RuleNumber -> Nomex Bool
- AddRule :: RuleInfo -> Nomex Bool
- ModifyRule :: RuleNumber -> RuleInfo -> Nomex Bool
- GetRules :: NomexNE [RuleInfo]
- GetPlayers :: NomexNE [PlayerInfo]
- SetPlayerName :: PlayerNumber -> PlayerName -> Nomex Bool
- DelPlayer :: PlayerNumber -> Nomex Bool
- NewOutput :: Maybe PlayerNumber -> NomexNE String -> Nomex OutputNumber
- GetOutput :: OutputNumber -> NomexNE (Maybe String)
- UpdateOutput :: OutputNumber -> NomexNE String -> Nomex Bool
- DelOutput :: OutputNumber -> Nomex Bool
- SetVictory :: NomexNE [PlayerNumber] -> Nomex ()
- CurrentTime :: NomexNE UTCTime
- SelfRuleNumber :: NomexNE RuleNumber
- Return :: a -> Exp e a
- Bind :: Exp e a -> (a -> Exp e b) -> Exp e b
- ThrowError :: String -> Exp Effect a
- CatchError :: Nomex a -> (String -> Nomex a) -> Nomex a
- LiftEffect :: NomexNE a -> Nomex a
- Simu :: Nomex a -> NomexNE Bool -> NomexNE Bool
- liftEffect :: NomexNE a -> Nomex a
- data V a = V {}
- data Event a where
- data Field a where
- data SomeField = forall a . Typeable a => SomeField (Field a)
- data Player
- data RuleEvent
- data Msg m = Msg String
- data InputForm a where
- type Rule = Nomex ()
- data RuleInfo = RuleInfo {}
- data RuleStatus
- data PlayerInfo = PlayerInfo {}
- data VictoryCond = VictoryCond RuleNumber (NomexNE [PlayerNumber])
- partial :: String -> Nomex (Maybe a) -> Nomex a
- concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]
- playAs :: Lens PlayerInfo (Maybe PlayerNumber)
- playerName :: Lens PlayerInfo String
- playerNumber :: Lens PlayerInfo PlayerNumber
- rAssessedBy :: Lens RuleInfo (Maybe RuleNumber)
- rStatus :: Lens RuleInfo RuleStatus
- rRule :: Lens RuleInfo Rule
- rRuleCode :: Lens RuleInfo Code
- rProposedBy :: Lens RuleInfo PlayerNumber
- rDescription :: Lens RuleInfo String
- rName :: Lens RuleInfo RuleName
- rNumber :: Lens RuleInfo RuleNumber
Documentation
type PlayerNumber = IntSource
type PlayerName = StringSource
type RuleNumber = IntSource
type EventNumber = IntSource
type OutputNumber = IntSource
type InputNumber = 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.
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.
liftEffect :: NomexNE a -> Nomex aSource
Variables
Events
Composable events
Base events
Type agnostic base event
Input forms
Rule
An informationnal structure about a rule
RuleInfo | |
|
data RuleStatus Source
the status of a rule.
Player
data PlayerInfo Source
informations on players
Victory
data VictoryCond Source
concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]Source