From e6b2b003bc7c806880a4249f7454f3306d9e4ac9 Mon Sep 17 00:00:00 2001 From: Fendor Date: Fri, 19 Feb 2021 21:58:02 +0100 Subject: [PATCH] Remove custom 'trim' implementation --- install/src/Env.hs | 4 +++- install/src/Print.hs | 7 +------ install/src/Stack.hs | 1 + 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/install/src/Env.hs b/install/src/Env.hs index 5dc77e1dfb..fcdfc3f78b 100644 --- a/install/src/Env.hs +++ b/install/src/Env.hs @@ -19,7 +19,9 @@ import Data.List ( sort , sortBy , isInfixOf ) -import Data.List.Extra ( nubOrdBy ) +import Data.List.Extra ( nubOrdBy + , trim + ) import Data.Ord ( comparing ) import Control.Monad.Extra ( mapMaybeM ) diff --git a/install/src/Print.hs b/install/src/Print.hs index b81a92a6c4..eb20854585 100644 --- a/install/src/Print.hs +++ b/install/src/Print.hs @@ -3,7 +3,7 @@ module Print where import Development.Shake import Control.Monad.IO.Class import Data.List ( dropWhileEnd ) -import Data.List.Extra ( trimStart, trimEnd ) +import Data.List.Extra ( trim ) import Data.Char ( isSpace ) -- | lift putStrLn to MonadIO @@ -22,11 +22,6 @@ embedInStars str = printInStars :: MonadIO m => String -> m () printInStars = liftIO . putStrLn . embedInStars - --- | Trim whitespace of both ends of a string -trim :: String -> String -trim = trimEnd . trimStart - -- | Trim the whitespace of the stdout of a command trimmedStdout :: Stdout String -> String trimmedStdout (Stdout s) = trim s diff --git a/install/src/Stack.hs b/install/src/Stack.hs index 012abf9594..e21bf8d549 100644 --- a/install/src/Stack.hs +++ b/install/src/Stack.hs @@ -1,6 +1,7 @@ {-# LANGUAGE CPP #-} module Stack where +import Data.List.Extra ( trim ) import Development.Shake import Development.Shake.FilePath import Control.Monad