GeoIp-0.3: Pure bindings for the MaxMind IP database.

Network.GeoIp.GeoCityIp

Description

This module loads the MaxMind's GeoIp City database.

Synopsis

Documentation

load :: FilePath -> IO (Either String GeoCityDB)Source

Load the city database. If an error is triggered then Left is returned with an error string.

findRange :: Monad m => GeoCityDB -> Integer -> m (Integer, Integer)Source

Find the IP range that the IP address is in. The result is monadic. In most cases you will want to use the Maybe monad.

findLocation :: Monad m => GeoCityDB -> Integer -> m (Double, Double)Source

Find the location of an IP address. The tuple returned is (latitude, longitude). The result is monadic, in most cases you will want to use the Maybe monad.