summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2018-12-30 14:36:37 -0400
committerJoey Hess2018-12-30 14:36:37 -0400
commit4ffc1eb9e2517a4bce4764858f8d073720ef51e0 (patch)
treef17e3317e0bcffd139b39ad70687463ba19f3844
parent714374151c9ed2297ac9a23a9ebd8344668fb426 (diff)
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.
-rw-r--r--src/Utility/Process.hs11
1 files changed, 4 insertions, 7 deletions
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