From 1c08bb700083d67ce5fbf5c955963bfed8150e3a Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Wed, 19 Jan 2022 13:48:47 -0500 Subject: Convince GHC that a certain pattern match is exhaustive --- Utility/Process.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Utility/Process.hs') diff --git a/Utility/Process.hs b/Utility/Process.hs index 1807a1335..90ddce81b 100644 --- a/Utility/Process.hs +++ b/Utility/Process.hs @@ -2,8 +2,9 @@ - processes, and logging. - - Copyright 2012-2015 Joey Hess + - Copyright 2022 Benjamin Barenblat - - - License: BSD-2-clause + - License: Apache-2.0 -} {-# LANGUAGE CPP, Rank2Types #-} @@ -178,12 +179,12 @@ withHandle h creator p a = creator p' $ a . select , std_out = Inherit , std_err = Inherit } - (select, p') - | h == StdinHandle = + (select, p') = case h of + StdinHandle -> (stdinHandle, base { std_in = CreatePipe }) - | h == StdoutHandle = + StdoutHandle -> (stdoutHandle, base { std_out = CreatePipe }) - | h == StderrHandle = + StderrHandle -> (stderrHandle, base { std_err = CreatePipe }) -- | Like withHandle, but passes (stdin, stdout) handles to the action. -- cgit v1.2.3