Safe Haskell | None |
---|---|
Language | Haskell2010 |
NationStates.Region
Contents
Description
The Region API.
This module should be imported qualified, to prevent name clashes:
import NationStates import qualified NationStates.Region as Region
In general, this module follows the terminology used in the official documentation.
Here's a short example:
import NationStates import qualified NationStates.Region as Region import Text.Printf main = do c <-newContext
"ExampleBot/2000" (name, numnations, delegate) <- Region.run
"Pony Lands" ((,,) <$> Region.name
<*> Region.numnations
<*> Region.delegate
) c printf "%s has %d nations. Its delegate is %s\n" name numnations delegate
- newtype Region a = Region {}
- run :: String -> Region a -> Context -> IO a
- name :: Region String
- factbook :: Region String
- numnations :: Region Integer
- nations :: Region [String]
- delegate :: Region (Maybe String)
- delegatevotes :: Region Integer
- gavote :: Region (Maybe (Integer, Integer))
- scvote :: Region (Maybe (Integer, Integer))
- founder :: Region (Maybe String)
- power :: Region String
- flag :: Region (Maybe String)
- embassies :: Region [String]
- tags :: Region [String]
Running queries
A request to the Region API.
Perform a request to the Region API.
Shards
factbook :: Region String Source
Factbook, in BBCode format.
"[b]We've got ponies, therefore your argument is invalid..."
numnations :: Region Integer Source
Number of nations in the region.
112
nations :: Region [String] Source
List of nations in the region.
["urmanian","enatai","unfitting_doors","lykosia","trotterdam"]
delegate :: Region (Maybe String) Source
Region delegate.
Returns Nothing
when the region has no delegate.
Just "princess_luna"
delegatevotes :: Region Integer Source
The number of endorsements earned by the delegate.
Returns 0
when the region has no delegate.
22
gavote :: Region (Maybe (Integer, Integer)) Source
The number of votes for and against the current General Assembly resolution.
Returns Nothing
when there is no proposal at vote.
Just (28,11)
scvote :: Region (Maybe (Integer, Integer)) Source
The number of votes for and against the current Security Council resolution.
Returns Nothing
when there is no proposal at vote.
Just (20,34)
founder :: Region (Maybe String) Source
Region founder.
Returns Nothing
when the region is founderless.
Just "magical_equestria"