mapquest-api-0.2.0.0: Bindings to the MapQuest API

Copyright(c) Marco Zocca 2018
LicenseGPL-3
Maintainerzocca.marco gmail
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Web.API.MapQuest

Contents

Description

 

Synopsis

Geocoding

request Source #

Arguments

:: Text

API key (available for free on https://developer.mapquest.com)

-> GeoQuery

Query address

-> IO (Maybe (Coords Float)) 

Call the MapQuest Geocoding API with a given address and extract the coordinates from the parsed result.

Example usage : assuming the user has bound key to hold the API key string, the following can be run in a GHCi shell :

>>> request key (GQ "Via Irnerio" "Bologna" "Italy")
Just (Coords {lat = 44.49897, long = 11.34503})
>>> request key (GQFree "Hong Kong")
Just (Coords {lat = 22.264412, long = 114.16706})

Parameters

data GeoQuery Source #

Geocoding query parameters

Constructors

GQ 

Fields

GQFree Text

Free-text query (must be a valid address or location)

Output

data Coords a Source #

Coordinates

Constructors

Coords 

Fields

Instances

Eq a => Eq (Coords a) Source # 

Methods

(==) :: Coords a -> Coords a -> Bool #

(/=) :: Coords a -> Coords a -> Bool #

Show a => Show (Coords a) Source # 

Methods

showsPrec :: Int -> Coords a -> ShowS #

show :: Coords a -> String #

showList :: [Coords a] -> ShowS #

Generic (Coords a) Source # 

Associated Types

type Rep (Coords a) :: * -> * #

Methods

from :: Coords a -> Rep (Coords a) x #

to :: Rep (Coords a) x -> Coords a #

type Rep (Coords a) Source # 
type Rep (Coords a) = D1 * (MetaData "Coords" "Web.API.MapQuest.Geocoding" "mapquest-api-0.2.0.0-MThyhTgR3yKlrOof9ZmxF" False) (C1 * (MetaCons "Coords" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "lat") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a)) (S1 * (MetaSel (Just Symbol "long") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * a))))