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.
This commit is contained in:
Joey Hess 2018-12-30 14:43:27 -04:00
parent 5bd618a1f6
commit 5480b3a9af
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -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