anticiv-0.1.0.5: This is an IRC bot for Mafia and Resistance.

Safe HaskellNone
LanguageHaskell2010

Network.Anticiv.Modules.Mafia.Core

Synopsis

Documentation

newtype PlayerId Source

Phantom type. Just to make sure. If a function gets a PlayerId passed, we're already sure it is contained in mafiaPlayers and don't need to handle the Nothing case any more, as it is already handled in toPID.

Constructors

UnsafePlayerId 

Fields

fromPID :: UserA
 

(%|) :: (MafiaStateA, PlayerId) -> (Role -> Bool) -> Anticiv Bool Source

Tries to match a predicate on any of the player's roles

(%&) :: (MafiaStateA, PlayerId) -> (Role -> a) -> Anticiv a Source

Runs a function on the most important of the player's roles

(%|&) :: (MafiaStateA, PlayerId) -> (Role -> a) -> Anticiv a Source

Like %&, but makes sure the observation reveals an oblique result

(%&&) :: (MafiaStateA, PlayerId) -> (Role -> Role -> a) -> PlayerId -> Anticiv a Source

Like %&, but takes another player

(#>) :: a -> Atom a -> Anticiv () Source

(#<) :: (a -> b) -> Atom a -> Anticiv b Source

(<>#) :: Atom a -> (a -> a) -> Anticiv () Source

shuffle :: [a] -> Anticiv [a] Source

That's Fisher-Yates, if I remember correctly