]> gitweb.michael.orlitzky.com - hath.git/blobdiff - src/Cidr.hs
Add hlint makefile target.
[hath.git] / src / Cidr.hs
index 7143a809b9975ee1d88844657ee7f5ee03cb011c..cdfef9a73c255af75c3f2e6fa0e73d3a8fc4f7ec 100644 (file)
@@ -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