X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCidr.hs;h=b5b3f744fd56651848387d7e010766bd328adb19;hb=18a81546e7c4ad10574918efb08b2e104e911d73;hp=e23ae6c1a55a2ba0e9c9de333cc4c8bbbb369453;hpb=942b8ef3bc5830ca0defa62342d55550aea59934;p=hath.git diff --git a/src/Cidr.hs b/src/Cidr.hs index e23ae6c..b5b3f74 100644 --- a/src/Cidr.hs +++ b/src/Cidr.hs @@ -30,6 +30,7 @@ import Test.Framework (Test, testGroup) import Test.Framework.Providers.HUnit (testCase) import Test.Framework.Providers.QuickCheck2 (testProperty) import Test.QuickCheck (Arbitrary(..), Gen, Property, (==>)) +import Text.Read (readMaybe) import qualified Bit as B import IPv4Address @@ -78,7 +79,7 @@ maskbits_from_cidr_string s -- of its octets (as Ints). octets_from_cidr_string :: String -> [Octet] octets_from_cidr_string s = - mapMaybe octet_from_string (take 4 (splitOneOf "./" s)) + mapMaybe readMaybe (take 4 (splitOneOf "./" s)) -- | Return Nothing if we can't parse both maskbits and octets from