| Copyright | (c) 2023 Finley McIlwaine |
|---|---|
| License | MIT (see LICENSE) |
| Maintainer | Finley McIlwaine <finleymcilwaine@gmail.com> |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.EBird.API.Regions
Description
Types related to eBird region API values.
Synopsis
- data Region
- data RegionType
- newtype RegionCode = RegionCode {}
- data RegionNameFormat
- data RegionInfo = RegionInfo {}
- data RegionBounds = RegionBounds {}
- data RegionListEntry = RegionListEntry {}
- regionInfoName :: Lens' RegionInfo Text
- regionInfoBounds :: Lens' RegionInfo (Maybe RegionBounds)
- regionBoundsMinY :: Lens' RegionBounds Double
- regionBoundsMinX :: Lens' RegionBounds Double
- regionBoundsMaxY :: Lens' RegionBounds Double
- regionBoundsMaxX :: Lens' RegionBounds Double
- regionListEntryRegion :: Lens' RegionListEntry Region
- regionListEntryName :: Lens' RegionListEntry Text
- parseRegionCode :: Parser RegionCode
- parseRegion :: Parser Region
- parseRegionNameFormat :: Parser RegionNameFormat
- parseRegionType :: Parser RegionType
Region-related API types
eBird divides the world into countries, subnational1 regions (states) or
subnational2 regions (counties). Location regions are eBird-specific
location identifiers.
Constructors
| Location Integer | Regions may be specified as location IDs, e.g. |
| World | The world is a region |
| Country Text | At the top level, the world is divided into countries |
| Subnational1 | Subnational1 regions are states within countries |
| Subnational2 | Subnational2 regions are counties within states |
Instances
data RegionType Source #
One constructor per eBird "region type" (countries, subnational1 (states), or subnational2 (counties)).
Constructors
| CountryType | |
| Subnational1Type | |
| Subnational2Type |
Instances
newtype RegionCode Source #
A RegionCode is a list of one or more Regions.
Constructors
| RegionCode | |
Fields | |
Instances
data RegionNameFormat Source #
RegionNameFormat values specify what format the API should return region
names in. See the constructor docs for examples.
Constructors
| DetailedNameFormat |
|
| DetailedNoQualNameFormat |
|
| FullNameFormat |
|
| NameQualNameFormat |
|
| NameOnlyNameFormat |
|
| RevDetailedNameFormat |
|
Instances
data RegionInfo Source #
RegionInfo specifies the name of a region (in some RegionNameFormat)
and the bounds of that region as RegionBounds.
Constructors
| RegionInfo | |
Fields | |
Instances
data RegionBounds Source #
RegionBounds specify the corners of a bounding box around a region.
Constructors
| RegionBounds | |
Fields | |
Instances
data RegionListEntry Source #
The data structure returned by the eBird SubregionListAPI and
AdjacentRegionsAPI.
Constructors
| RegionListEntry | |
Fields | |
Instances
Optics for region-related API types
attoparsec parsers
parseRegion :: Parser Region Source #
Parse an eBird API region. This parser only ensures that the input is somewhat well-formed, in that it is either:
- A
Locationregion (an 'L' followed by an integral number) - The
Worldregion (just the string "world") - A
Subnational2region (formatted as "LETTERS-LETTERS-NUMBER" where LETTERS is one or more letters in any case, and NUMBERS is an integral number) - A
Subnational1region (formatterd as "LETTERS-LETTERS") - A
Countryregion (just "LETTERS")
parseRegionNameFormat :: Parser RegionNameFormat Source #
Parse an eBird API RegionNameFormat.
parseRegionType :: Parser RegionType Source #
Parse an eBird API RegionType.