[Git][ghc/ghc][wip/jeltsch/system-io-uncovering] Move the `GHCi.Helpers` implementation into `base`
Wolfgang Jeltsch pushed to branch wip/jeltsch/system-io-uncovering at Glasgow Haskell Compiler / GHC Commits: d4c75552 by Wolfgang Jeltsch at 2026-02-25T17:46:52+02:00 Move the `GHCi.Helpers` implementation into `base` - - - - - 3 changed files: - libraries/base/src/GHC/GHCi/Helpers.hs - libraries/ghc-internal/ghc-internal.cabal.in - − libraries/ghc-internal/src/GHC/Internal/GHCi/Helpers.hs Changes: ===================================== libraries/base/src/GHC/GHCi/Helpers.hs ===================================== @@ -1,4 +1,4 @@ -{-# LANGUAGE Safe #-} +{-# LANGUAGE Trustworthy #-} -- | -- @@ -24,4 +24,21 @@ module GHC.GHCi.Helpers evalWrapper ) where -import GHC.Internal.GHCi.Helpers \ No newline at end of file +import GHC.Internal.Base +import GHC.Internal.System.IO +import GHC.Internal.System.Environment + +disableBuffering :: IO () +disableBuffering = do + hSetBuffering stdin NoBuffering + hSetBuffering stdout NoBuffering + hSetBuffering stderr NoBuffering + +flushAll :: IO () +flushAll = do + hFlush stdout + hFlush stderr + +evalWrapper :: String -> [String] -> IO a -> IO a +evalWrapper progName args m = + withProgName progName (withArgs args m) ===================================== libraries/ghc-internal/ghc-internal.cabal.in ===================================== @@ -228,7 +228,6 @@ Library GHC.Internal.ForeignPtr GHC.Internal.Functor.ZipList GHC.Internal.GHCi - GHC.Internal.GHCi.Helpers GHC.Internal.Generics GHC.Internal.Heap.Closures GHC.Internal.Heap.Constants ===================================== libraries/ghc-internal/src/GHC/Internal/GHCi/Helpers.hs deleted ===================================== @@ -1,44 +0,0 @@ -{-# LANGUAGE Trustworthy #-} - ------------------------------------------------------------------------------ --- | --- Module : GHC.Internal.GHCi.Helpers --- Copyright : (c) The GHC Developers --- License : see libraries/base/LICENSE --- --- Maintainer : ghc-devs@haskell.org --- Stability : internal --- Portability : non-portable (GHC Extensions) --- --- Various helpers used by the GHCi shell. --- --- /The API of this module is unstable and not meant to be consumed by the general public./ --- If you absolutely must depend on it, make sure to use a tight upper --- bound, e.g., @base < 4.X@ rather than @base < 5@, because the interface can --- change rapidly without much warning. --- ------------------------------------------------------------------------------ - -module GHC.Internal.GHCi.Helpers - ( disableBuffering, flushAll - , evalWrapper - ) where - -import GHC.Internal.Base -import GHC.Internal.System.IO -import GHC.Internal.System.Environment - -disableBuffering :: IO () -disableBuffering = do - hSetBuffering stdin NoBuffering - hSetBuffering stdout NoBuffering - hSetBuffering stderr NoBuffering - -flushAll :: IO () -flushAll = do - hFlush stdout - hFlush stderr - -evalWrapper :: String -> [String] -> IO a -> IO a -evalWrapper progName args m = - withProgName progName (withArgs args m) View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d4c755528af30ab77fdf8a9bce5c1957... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d4c755528af30ab77fdf8a9bce5c1957... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Wolfgang Jeltsch (@jeltsch)