From 4ffc1eb9e2517a4bce4764858f8d073720ef51e0 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 30 Dec 2018 14:36:37 -0400 Subject: fix bogus ghc 8.6.3 build warning ghc warned that the guard 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. --- src/Utility/Process.hs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/Utility') diff --git a/src/Utility/Process.hs b/src/Utility/Process.hs index 6d981cb5..48e03f41 100644 --- a/src/Utility/Process.hs +++ b/src/Utility/Process.hs @@ -248,13 +248,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 -- cgit v1.2.3