X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2FCidr.hs;h=cdfef9a73c255af75c3f2e6fa0e73d3a8fc4f7ec;hb=3c9316fed6fd100be9a5e1f8d72db6534fb163cd;hp=002ec0b849fc08d555a2e6ab221212143c51d160;hpb=e1d16438b44ecd962565756a828c9ed8014cf894;p=hath.git diff --git a/src/Cidr.hs b/src/Cidr.hs index 002ec0b..cdfef9a 100644 --- a/src/Cidr.hs +++ b/src/Cidr.hs @@ -22,7 +22,7 @@ module Cidr import Data.List (nubBy) import Data.List.Split (splitOneOf) -import Data.Maybe (catMaybes, fromJust) +import Data.Maybe (catMaybes, fromJust, mapMaybe) import Test.HUnit (assertEqual) import Test.Framework (Test, testGroup) @@ -77,7 +77,7 @@ maskbits_from_cidr_string s -- of its octets (as Ints). octets_from_cidr_string :: String -> [Octet] octets_from_cidr_string s = - catMaybes $ map octet_from_string (take 4 (splitOneOf "./" s)) + mapMaybe octet_from_string (take 4 (splitOneOf "./" s)) -- | Return Nothing if we can't parse both maskbits and octets from @@ -165,7 +165,7 @@ max_octet4 cidr = octet4 (max_host cidr) -- cidr1, then at least mbits1 of an address in cidr2 will match -- cidr1. For example, -- --- cidr1 = 192.168.1.0/23, cidr2 = 192.168.1.100/24 +-- cidr1 = 192.168.1.0\/23, cidr2 = 192.168.1.100\/24 -- -- Here, cidr2 contains all of 192.168.1.0 through -- 192.168.1.255. However, cidr1 contains BOTH 192.168.0.0 through