Skip to content

Commit

Permalink
Remove custom 'trim' implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Feb 19, 2021
1 parent ba12bbd commit 2a03abb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 3 additions & 1 deletion install/src/Env.hs
Expand Up @@ -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 )

Expand Down
7 changes: 1 addition & 6 deletions install/src/Print.hs
Expand Up @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions 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
Expand Down

0 comments on commit 2a03abb

Please sign in to comment.