nationstates-0.5.0.0: NationStates API client

Safe HaskellNone
LanguageHaskell2010

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

Synopsis

Running queries

newtype Region a #

A request to the Region API.

Constructors

Region 

Fields

Instances

Functor Region # 

Methods

fmap :: (a -> b) -> Region a -> Region b #

(<$) :: a -> Region b -> Region a #

Applicative Region # 

Methods

pure :: a -> Region a #

(<*>) :: Region (a -> b) -> Region a -> Region b #

(*>) :: Region a -> Region b -> Region b #

(<*) :: Region a -> Region b -> Region a #

run #

Arguments

:: String

Region name

-> Region a

Requested shards

-> Context

Connection manager

-> IO a 

Perform a request to the Region API.

Shards

name :: Region String #

Region name.

"Pony Lands"

factbook :: Region String #

Factbook, in BBCode format.

"[b]We&#39;ve got ponies, therefore your argument is invalid..."

numnations :: Region Integer #

Number of nations in the region.

112

nations :: Region [String] #

List of nations in the region.

["urmanian","enatai","unfitting_doors","lykosia","trotterdam"]

delegate :: Region (Maybe String) #

Region delegate.

Returns Nothing when the region has no delegate.

Just "princess_luna"

delegatevotes :: Region Integer #

The number of endorsements earned by the delegate.

Returns 0 when the region has no delegate.

22

gavote :: Region (Maybe (Integer, Integer)) #

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)) #

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) #

Region founder.

Returns Nothing when the region is founderless.

Just "magical_equestria"

power :: Region String #

Regional power.

"High"

flag :: Region (Maybe String) #

Regional flag.

Just "http://www.nationstates.net/images/flags/uploads/rflags/pony_lands__478033.png"

embassies :: Region [String] #

Region embassies.

["New Lunar Republic","Tareldanore"]

tags :: Region [String] #

Region tags.

["Silly","Monarchist","Large"]