From 75658e4b6adeb5fd47be4375cb2078773ed3178c Mon Sep 17 00:00:00 2001 From: Kirill Zaborsky Date: Sat, 27 Feb 2021 13:38:15 +0300 Subject: [PATCH] Use fromRight from hlint suggestion As reported in https://github.com/commercialhaskell/stack/pull/5494/checks?check_run_id=1987494996 --- src/main/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/Main.hs b/src/main/Main.hs index 60f00e8cd0..ac8d42d7f9 100644 --- a/src/main/Main.hs +++ b/src/main/Main.hs @@ -553,7 +553,7 @@ cleanCmd = withConfig NoReexec . withBuildConfig . clean -- | Helper for build and install commands buildCmd :: BuildOptsCLI -> RIO Runner () buildCmd opts = do - when (any (("-prof" `elem`) . either (const []) id . parseArgs Escaping) (boptsCLIGhcOptions opts)) $ do + when (any (("-prof" `elem`) . fromRight [] . parseArgs Escaping) (boptsCLIGhcOptions opts)) $ do logError "Error: When building with stack, you should not use the -prof GHC option" logError "Instead, please use --library-profiling and --executable-profiling" logError "See: https://github.com/commercialhaskell/stack/issues/1015"