Copyright | (c) 2023 Finley McIlwaine |
---|---|
License | MIT (see LICENSE) |
Maintainer | Finley McIlwaine <finleymcilwaine@gmail.com> |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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.
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)).
Instances
newtype RegionCode Source #
A RegionCode
is a list of one or more Region
s.
Instances
data RegionNameFormat Source #
RegionNameFormat
values specify what format the API should return region
names in. See the constructor docs for examples.
DetailedNameFormat |
|
DetailedNoQualNameFormat |
|
FullNameFormat |
|
NameQualNameFormat |
|
NameOnlyNameFormat |
|
RevDetailedNameFormat |
|
Instances
IsString RegionNameFormat Source # | Use this instance carefully! It throws runtime exceptions if the string is malformatted. |
Defined in Data.EBird.API.Regions fromString :: String -> RegionNameFormat # | |
Read RegionNameFormat Source # | |
Defined in Data.EBird.API.Regions | |
Show RegionNameFormat Source # | |
Defined in Data.EBird.API.Regions showsPrec :: Int -> RegionNameFormat -> ShowS # show :: RegionNameFormat -> String # showList :: [RegionNameFormat] -> ShowS # | |
EBirdString RegionNameFormat Source # | A |
Defined in Data.EBird.API.Regions | |
Eq RegionNameFormat Source # | |
Defined in Data.EBird.API.Regions (==) :: RegionNameFormat -> RegionNameFormat -> Bool # (/=) :: RegionNameFormat -> RegionNameFormat -> Bool # | |
ToHttpApiData RegionNameFormat Source # | |
Defined in Data.EBird.API.Regions |
data RegionInfo Source #
RegionInfo
specifies the name of a region (in some RegionNameFormat
)
and the bounds of that region as RegionBounds
.
Instances
data RegionBounds Source #
RegionBounds
specify the corners of a bounding box around a region.
Instances
data RegionListEntry Source #
The data structure returned by the eBird SubregionListAPI
and
AdjacentRegionsAPI
.
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
Location
region (an 'L' followed by an integral number) - The
World
region (just the string "world") - A
Subnational2
region (formatted as "LETTERS-LETTERS-NUMBER" where LETTERS is one or more letters in any case, and NUMBERS is an integral number) - A
Subnational1
region (formatterd as "LETTERS-LETTERS") - A
Country
region (just "LETTERS")
parseRegionNameFormat :: Parser RegionNameFormat Source #
Parse an eBird API RegionNameFormat
.
parseRegionType :: Parser RegionType Source #
Parse an eBird API RegionType
.