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)
-- 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