From 5480b3a9af4797884a4d936c095a49dd69c0e47e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Dec 2018 14:43:27 -0400 Subject: [PATCH] fix bogus ghc 8.6.3 build warning ghc warned that the guards did not cover all values of h, but they clearly do, and when rewritten as a case statement the warning goes away. Probably a ghc bug, but I kind of prefer the case statement over the guards anyway. --- Utility/Process.hs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Utility/Process.hs b/Utility/Process.hs index c8b187abb2..af3a5f4f62 100644 --- a/Utility/Process.hs +++ b/Utility/Process.hs @@ -178,13 +178,10 @@ withHandle h creator p a = creator p' $ a . select , std_out = Inherit , std_err = Inherit } - (select, p') - | h == StdinHandle = - (stdinHandle, base { std_in = CreatePipe }) - | h == StdoutHandle = - (stdoutHandle, base { std_out = CreatePipe }) - | h == StderrHandle = - (stderrHandle, base { std_err = CreatePipe }) + (select, p') = case h of + StdinHandle -> (stdinHandle, base { std_in = CreatePipe }) + StdoutHandle -> (stdoutHandle, base { std_out = CreatePipe }) + StderrHandle -> (stderrHandle, base { std_err = CreatePipe }) -- | Like withHandle, but passes (stdin, stdout) handles to the action. withIOHandles