nationstates-0.3.0.1: 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

unRegion :: NS 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 String Source

Region delegate.

"princess_luna"