IPv6Addr 2.0.5 → 2.0.5.1
raw patch · 2 files changed
+15/−24 lines, 2 filesdep ~aesonPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson
API changes (from Hackage documentation)
Files
- IPv6Addr.cabal +4/−13
- Text/IPv6Addr.hs +11/−11
IPv6Addr.cabal view
@@ -1,5 +1,5 @@ name: IPv6Addr-version: 2.0.5+version: 2.0.5.1 synopsis: Library to deal with IPv6 address text representations. description: Library to deal with IPv6 address text representations, canonization and manipulations. homepage: https://github.com/MichelBoucey/IPv6Addr@@ -7,22 +7,13 @@ license-file: LICENSE author: Michel Boucey maintainer: michel.boucey@gmail.com-copyright: (c) 2011-2022 - Michel Boucey+copyright: (c) 2011-2023 - Michel Boucey category: Network build-type: Simple extra-source-files: README.md cabal-version: >=1.10 -Tested-With:- GHC == 8.0.2- || == 8.2.2- || == 8.4.4- || == 8.6.5- || == 8.8.4- || == 8.10.7- || == 9.0.2- || == 9.2.3- || == 9.4.1+Tested-With: GHC ==8.8.4 || ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.2 Source-Repository head Type: git@@ -37,7 +28,7 @@ , network >=2.5 && < 4 , random >=1.0 && < 1.3 , attoparsec >=0.12 && < 0.15- , aeson >= 0.8.0.2 && < 1.6 || >= 2.0 && < 2.2+ , aeson >= 0.8.0.2 && < 1.6 || >= 2.0 && < 2.3 , network-info >=0.2 && <=0.3 default-language: Haskell2010 GHC-Options: -Wall
Text/IPv6Addr.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE CPP #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings #-} module Text.IPv6Addr@@ -28,20 +28,20 @@ , getTokMacAddrOf ) where import Control.Applicative ((<|>))-import Control.Monad (replicateM, guard)+import Control.Monad (guard, replicateM) import Data.Aeson import Data.Attoparsec.Text import Data.Char (intToDigit, isDigit) import Data.IP (IPv6)-import Data.List (elemIndex, elemIndices, group,+import Data.List (elemIndex, elemIndices, foldl', group, intersperse, isSuffixOf) import Data.Maybe (fromJust, isJust) #if !MIN_VERSION_base(4,11,0)-import Data.Monoid ((<>))+import Data.Monoid ((<>)) #endif -import qualified Data.Text as T+import qualified Data.Text as T hiding (foldl') import qualified Data.Text.Read as R (decimal) #if MIN_VERSION_network (2,7,0)@@ -219,7 +219,7 @@ -- ------------------------------------------------------------------------ ----- Manipulations --+-- Manipulations of IPv6 address chunks -- -- ------------------------------------------------------------------------ -- -- | Returns 'Just' a random 'SixteenBit' token based on a mask \"____\", each@@ -332,8 +332,8 @@ case t of DoubleColon -> case h of- Colon -> False- _ -> True + Colon -> False+ _ -> True SixteenBit _ -> case h of SixteenBit _ -> False@@ -391,8 +391,8 @@ maybeIPv6AddrTokens :: T.Text -> Maybe [IPv6AddrToken] maybeIPv6AddrTokens s = case readText s of- Done "" l -> Just l- _ -> Nothing+ Done "" l -> Just l+ _ -> Nothing where readText _s = feed@@ -470,7 +470,7 @@ where allZerosTokensReplacement x = intersperse Colon (replicate x AllZeros) quantityOfAllZerosTokenToReplace _x =- ntks tks - foldl (\c _x -> if (_x /= DoubleColon) && (_x /= Colon) then c+1 else c) 0 _x+ ntks tks - foldl' (\c _x -> if (_x /= DoubleColon) && (_x /= Colon) then c+1 else c) 0 _x where ntks _tks = if countIPv4Addr _tks == 1 then 7 else 8