ebird-api-0.2.0.0: A Haskell description of the eBird API
Copyright(c) 2023 Finley McIlwaine
LicenseMIT (see LICENSE)
MaintainerFinley McIlwaine <finleymcilwaine@gmail.com>
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.EBird.API.EBirdString

Description

The EBirdString class contains types whose values may be represented as strings compatible with the eBird API.

Synopsis

The class

class EBirdString a where Source #

A convenience class for converting the litany of eBird API types to and from their respective eBird API compatible string representations.

Methods

toEBirdString :: a -> Text Source #

Convert a value to an eBird string.

fromEBirdString :: Text -> Either Text a Source #

Parse a string into an eBird value. If parsing fails, this should result in Left with an error message.

Instances

Instances details
EBirdString SortChecklistsBy Source #

The eBird string for a SortChecklistsBy value is either "obs_dt" or "creation_dt".

Instance details

Defined in Data.EBird.API.Checklists

EBirdString CSVOrJSONFormat Source #

The eBird string of a CSVOrJSONFormat value is either "csv" or "json".

Instance details

Defined in Data.EBird.API.Hotspots

EBirdString DetailLevel Source #

The eBird string for a DetailLevel value is simply the lowercase constructor name.

Instance details

Defined in Data.EBird.API.Observations

EBirdString SelectObservation Source #

The eBird string for a SelectObservation value is either "create" or "mrec".

Instance details

Defined in Data.EBird.API.Observations

EBirdString SortObservationsBy Source #

The eBird string for a SortObservationsBy value is either "date" or "species".

Instance details

Defined in Data.EBird.API.Observations

EBirdString RankTop100By Source #

The eBird string for a RankTop100By value is either "spp" or "cl".

Instance details

Defined in Data.EBird.API.Product

EBirdString Region Source #

A Region eBird string is either:

  • "L227544" for location regions, where L227544 is the location ID.
  • "world" for World regions.
  • The country identifier (e.g. "US" for the United States) for Country regions.
  • The country identifier and the state identifier separated by a hyphen for Subnational1 regions (e.g. "US-WY" for Wyoming in the United States).
  • The county identifier, the state identifier, and the country identifier separated by hyphens for Subnational2 regions (e.g. US-WY-013)
Instance details

Defined in Data.EBird.API.Regions

EBirdString RegionCode Source #

A RegionCode eBird string is a comma-separated list of regions.

Instance details

Defined in Data.EBird.API.Regions

EBirdString RegionNameFormat Source #

A RegionNameFormat is shown as the constructor name without the NameFormat suffix, in all lower-case.

Instance details

Defined in Data.EBird.API.Regions

EBirdString RegionType Source #

Results in eBird region type format

Instance details

Defined in Data.EBird.API.Regions

EBirdString SPPGrouping Source #

The eBird string of an SPPGrouping is either "merlin" or "ebird"

Instance details

Defined in Data.EBird.API.Taxonomy

EBirdString SPPLocale Source #

The eBird strings of the species locales are simply the lowercase constructor names.

Instance details

Defined in Data.EBird.API.Taxonomy

EBirdString SpeciesCode Source #

The eBird string of a SpeciesCode is simply the literal string

Instance details

Defined in Data.EBird.API.Taxonomy

EBirdString SpeciesCodes Source #

The eBird string of a SpeciesCodes is simply the comma-separated SpeciesCodes

Instance details

Defined in Data.EBird.API.Taxonomy

EBirdString TaxonomyCategories Source #

The eBird string of a TaxonomyCategories is the comma-separated list of category strings.

Instance details

Defined in Data.EBird.API.Taxonomy

EBirdString TaxonomyCategory Source #

The eBird strings of the taxonomy categories are simply the lowercase constructor names.

Instance details

Defined in Data.EBird.API.Taxonomy

EBirdString EBirdDate Source #

eBird dates are formatted as YYYY-MM-DD, with 0 padding where necessary.

Instance details

Defined in Data.EBird.API.Util.Time

EBirdString EBirdDateTime Source #

eBird datetimes are formatted as YYYY-MM-DD HH:MM, with 0 padding where necessary.

Instance details

Defined in Data.EBird.API.Util.Time

EBirdString EBirdTime Source #

eBird times are formatted as HH:MM, with 0 padding where necessary.

Instance details

Defined in Data.EBird.API.Util.Time

Unsafe interface

unsafeFromEBirdString :: (HasCallStack, EBirdString a) => Text -> a Source #

Parse a string into an eBird value unsafely.

Be careful! This can result in runtime errors if the string is malformatted.