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 Source

A request to the Region API.

Constructors

Region 

Fields

Instances

Functor Region Source 

Methods

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

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

Applicative Region Source 

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 Source

Arguments

:: String

Region name

-> Region a

Requested shards

-> Context

Connection manager

-> IO a 

Perform a request to the Region API.

Shards

name :: Region String Source

Region name.

"Pony Lands"

factbook :: Region String Source

Factbook, in BBCode format.

"[b]We&#39;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"

power :: Region String Source

Regional power.

"High"

flag :: Region (Maybe String) Source

Regional flag.

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

embassies :: Region [String] Source

Region embassies.

["New Lunar Republic","Tareldanore"]

tags :: Region [String] Source

Region tags.

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