Skip to content

Commit

Permalink
Use runIdentity instead of unsafePerformIO
Browse files Browse the repository at this point in the history
  • Loading branch information
rnjtranjan authored and harendra-kumar committed Dec 9, 2022
1 parent afc3224 commit 11713fd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Utils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,16 @@ module Utils
import Control.Monad.IO.Class (MonadIO(..))
import Control.Monad.Catch (MonadCatch(..))
import Data.Function ((&))
import Data.Functor.Identity (runIdentity)
import Data.Maybe (fromJust)
import System.FilePath (takeDirectory)
import System.Environment (getExecutablePath)
import Streamly.Internal.System.Process (ProcessFailure)
import Streamly.Internal.Unicode.String (str)
import System.IO.Unsafe (unsafePerformIO)

import qualified System.Exit as Exit (die)
import qualified Streamly.Data.Fold as Fold
import qualified Streamly.Data.Stream as Stream
import qualified Streamly.Internal.Data.Stream as Stream (parseMany)
import qualified Streamly.Internal.Data.Parser as Parser (wordQuotedBy)
import qualified Streamly.System.Sh as Sh

Expand All @@ -42,7 +41,7 @@ import qualified Streamly.System.Sh as Sh

wordsQuoted :: String -> [String]
wordsQuoted =
unsafePerformIO
runIdentity
. Stream.fold Fold.toList
. Stream.catRights
. Stream.parseMany parser
Expand Down

0 comments on commit 11713fd

Please sign in to comment.