Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a simple interface to Ziptastic's forward and reverse geocoding API (https://www.getziptastic.com/).
{-# LANGUAGE OverloadedStrings #-} import Data.ISO3166_CountryCodes (CountryCode(US)) import Network.HTTP.Client (newManager) import Network.HTTP.Client.TLS (tlsManagerSettings) import Ziptastic.Client apiKey :: ApiKey apiKey = "abcdefghijklmnopqrstuvwxyz" main :: IO () main = do manager <- newManager tlsManagerSettings print =<< forwardGeocode apiKey manager US "48867" print =<< reverseGeocode apiKey manager 42.9934 (-84.1595)
- newtype ApiKey :: * = ApiKey {}
- data LocaleInfo :: * = LocaleInfo {}
- data LocaleCoords :: * = LocaleCoords {}
- forwardGeocode :: ApiKey -> Manager -> CountryCode -> Text -> IO (Either String [LocaleInfo])
- reverseGeocode :: ApiKey -> Manager -> Double -> Double -> IO (Either String [LocaleInfo])
- reverseGeocodeWithRadius :: ApiKey -> Manager -> Double -> Double -> Int -> IO (Either String [LocaleInfo])
Documentation
data LocaleInfo :: * #
LocaleInfo | |
|
data LocaleCoords :: * #
LocaleCoords | |
|
:: ApiKey | |
-> Manager | HTTP connection manager |
-> CountryCode | country |
-> Text | postal code |
-> IO (Either String [LocaleInfo]) |