From f6b6b36eb75ae8ea279f1c84a9e89842e2891e5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hr=C4=8Dek?= Date: Sun, 29 Aug 2021 17:08:06 +0200 Subject: [PATCH] Apply hlint 3.3.2 suggestions --- lib/GHCup/Platform.hs | 4 +--- lib/GHCup/Utils/File/Posix.hs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/GHCup/Platform.hs b/lib/GHCup/Platform.hs index b2240be..9ce3e16 100644 --- a/lib/GHCup/Platform.hs +++ b/lib/GHCup/Platform.hs @@ -142,9 +142,7 @@ getLinuxDistro = do | otherwise -> UnknownLinux pure (distro, parsedVer) where - hasWord t matches = foldr (\x y -> match (regex x) (T.unpack t) || y) - False - matches + hasWord t = any (\x -> match (regex x) (T.unpack t)) where regex x = makeRegexOpts compIgnoreCase execBlank ([s|\<|] ++ x ++ [s|\>|]) diff --git a/lib/GHCup/Utils/File/Posix.hs b/lib/GHCup/Utils/File/Posix.hs index 78bb2df..8f0c850 100644 --- a/lib/GHCup/Utils/File/Posix.hs +++ b/lib/GHCup/Utils/File/Posix.hs @@ -131,7 +131,7 @@ execLogged exe args chdir lfile env = do pure e tee :: Fd -> Fd -> IO () - tee fileFd fdIn = readTilEOF lineAction fdIn + tee fileFd = readTilEOF lineAction where lineAction :: ByteString -> IO ()