From: Michael Orlitzky Date: Wed, 6 Jul 2016 21:20:17 +0000 (-0400) Subject: Add a type signature to a local function definition. X-Git-Tag: 0.4.0~22 X-Git-Url: http://gitweb.michael.orlitzky.com/?p=hath.git;a=commitdiff_plain;h=9dcb70651417b7e91ccea3186b409befac2e6f71 Add a type signature to a local function definition. --- diff --git a/src/Main.hs b/src/Main.hs index d66b600..26d54d1 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -5,12 +5,12 @@ import Control.Monad (when) import Data.List ((\\), intercalate) import Data.Maybe (catMaybes, isNothing) import Data.String.Utils (splitWs) -import System.Exit (ExitCode(..), exitWith) +import System.Exit (ExitCode( ExitFailure ), exitWith) import System.IO (stderr, hPutStrLn) import Text.Read (readMaybe) import Cidr ( - Cidr(..), + Cidr(), combine_all, enumerate, max_octet1, @@ -51,7 +51,7 @@ add_barriers x = non_addr_char ++ x ++ non_addr_char -- 5. Stick an address boundary on either side of the result if -- use_barriers is True. -- -cidr_to_regex :: Bool -> Cidr.Cidr -> String +cidr_to_regex :: Bool -> Cidr -> String cidr_to_regex use_barriers cidr = let f = if use_barriers then add_barriers else id in f (intercalate "\\." [range1, range2, range3, range4]) @@ -109,7 +109,9 @@ main = do -- Output the bad lines, safely. let pairs = zip cidr_strings cidrs - let print_pair (x, Nothing) = hPutStrLn stderr (" * " ++ x) + + let print_pair :: (String, Maybe Cidr) -> IO () + print_pair (x, Nothing) = hPutStrLn stderr (" * " ++ x) print_pair (_, _) = return () mapM_ print_pair pairs