Add type annotation to avoid monomorphism restriction
authorKlaus Aehlig <aehlig@google.com>
Mon, 10 Jun 2013 14:45:17 +0000 (16:45 +0200)
committerKlaus Aehlig <aehlig@google.com>
Mon, 10 Jun 2013 15:04:56 +0000 (17:04 +0200)
Even though we need the let-bound variable showMoves only
at type [(String, String)] -> IO (), it's most general type
would be (PrintfArg a, PrintfArg b) => [(a, b)] -> IO ().
This causes the monomorphism restriction apply to that binding,
which is a warning (and, thanks to -Werror, fatal) on some
ghc versions.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

src/Ganeti/HTools/Program/Hroller.hs

index 4d25dd6..e0f56b0 100644 (file)
@@ -277,6 +277,7 @@ main opts args = do
   let showGroup = if optOneStepOnly opts
                     then mapM_ putStrLn
                     else putStrLn . commaJoin
+      showMoves :: [(String, String)] -> IO ()
       showMoves = if optPrintMoves opts
                     then mapM_ $ putStrLn . uncurry (printf "  %s %s")
                     else const $ return ()