geoip2 0.2.2.0 → 0.3.0.0
raw patch · 3 files changed
+17/−4 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
+ Data.GeoIP2: instance GHC.Classes.Eq Data.GeoIP2.Location
+ Data.GeoIP2: instance GHC.Show.Show Data.GeoIP2.Location
- Data.GeoIP2: GeoResult :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe (Double, Double) -> Maybe Text -> Maybe Text -> [(Text, Text)] -> GeoResult
+ Data.GeoIP2: GeoResult :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Location -> Maybe Text -> Maybe Text -> [(Text, Text)] -> GeoResult
- Data.GeoIP2: [geoLocation] :: GeoResult -> Maybe (Double, Double)
+ Data.GeoIP2: [geoLocation] :: GeoResult -> Maybe Location
Files
- ChangeLog.md +3/−0
- Data/GeoIP2.hs +12/−2
- geoip2.cabal +2/−2
ChangeLog.md view
@@ -1,3 +1,6 @@+# 0.3.0.0+- Include timezone and accuracy in location results+ # 0.2.0.1 - Fixed a problem with correct decoding of 28-bit offsets
Data/GeoIP2.hs view
@@ -113,12 +113,19 @@ , geoContinentCode :: Maybe T.Text , geoCountryISO :: Maybe T.Text , geoCountry :: Maybe T.Text- , geoLocation :: Maybe (Double, Double)+ , geoLocation :: Maybe Location , geoCity :: Maybe T.Text , geoPostalCode :: Maybe T.Text , geoSubdivisions :: [(T.Text, T.Text)] } deriving (Show, Eq) +data Location = Location {+ locationLatitude :: Double+ , locationLongitude :: Double+ , locationTimezone :: T.Text+ , locationAccuracy :: Int+} deriving (Show, Eq)+ -- | Search GeoIP database findGeoData :: GeoDB -- ^ Db handle@@ -134,7 +141,10 @@ (res .:? "continent" ..? "code") (res .:? "country" ..? "iso_code") (res .:? "country" ..? "names" ..? lang)- ((,) <$> res .:? "location" ..? "latitude" <*> res .:? "location" ..? "longitude")+ (Location <$> res .:? "location" ..? "latitude"+ <*> res .:? "location" ..? "longitude"+ <*> res .:? "location" ..? "time_zone"+ <*> res .:? "location" ..? "accuracy_radius") (res .:? "city" ..? "names" ..? lang) (res .:? "postal" ..? "code") (fromMaybe [] subdivs)
geoip2.cabal view
@@ -1,5 +1,5 @@ name: geoip2-version: 0.2.2.0+version: 0.3.0.0 synopsis: Pure haskell interface to MaxMind GeoIP database description: GeoIP2 is a haskell binding to the MaxMind GeoIP2 database.@@ -23,7 +23,7 @@ library exposed-modules: Data.GeoIP2 other-modules: Data.GeoIP2.Fields, Data.GeoIP2.SearchTree- build-depends: base >=4.7 && <4.10+ build-depends: base >=4.7 && <5 , mmap , bytestring , cereal