Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use runIdentity instead of unsafePerformIO #34

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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