geoip2 0.3.1.0 → 0.3.1.1
raw patch · 4 files changed
+10/−3 lines, 4 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- ChangeLog.md +3/−0
- Data/GeoIP2.hs +4/−1
- Data/GeoIP2/Fields.hs +2/−1
- geoip2.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,6 @@+# 0.3.0.1+- Fix compiling with GHC 8.6.1+ # 0.3.0.0 - Include timezone and accuracy in location results
Data/GeoIP2.hs view
@@ -134,7 +134,7 @@ -> IP -- ^ IP address to search -> Either String GeoResult -- ^ Result, if something is found findGeoData geodb lang ip = do- (DataMap res) <- rawGeoData geodb ip+ res <- rawGeoData geodb ip >>= asMap let subdivmap = res .:? "subdivisions" :: Maybe [Map.Map GeoField GeoField] subdivs = mapMaybe (\s -> (,) <$> s .:? "iso_code" <*> s .:? "names" ..? lang) <$> subdivmap @@ -149,3 +149,6 @@ (res .:? "city" ..? "names" ..? lang) (res .:? "postal" ..? "code") (fromMaybe [] subdivs)+ where+ asMap (DataMap res) = return res+ asMap _ = Left "rawGeoData returned something else than DataMap"
Data/GeoIP2/Fields.hs view
@@ -84,7 +84,7 @@ return $ BS.foldl' (\acc new -> fromIntegral new + 256 * acc) 0 bytes instance Serialize GeoField where- put = undefined+ put = error "Serialization not implemented" get = do control <- getWord8 ftype <- if | control .&. 0xe0 == 0 -> (+7) <$> getWord8@@ -104,6 +104,7 @@ | _fsize == 29 -> (29+) <$> parseNumber 1 | _fsize == 30 -> (285+) <$> parseNumber 2 | _fsize == 31 -> (65821+) <$> parseNumber 3+ | otherwise -> error "Shouldn't happen, limited to 5 bits" case ftype of 1 -> return $ DataPointer fsize
geoip2.cabal view
@@ -1,5 +1,5 @@ name: geoip2-version: 0.3.1.0+version: 0.3.1.1 synopsis: Pure haskell interface to MaxMind GeoIP database description: GeoIP2 is a haskell binding to the MaxMind GeoIP2 database.