[Git][ghc/ghc][master] ghci: Mention active language edition in startup banner
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: e34cb6da by Adam Gundry at 2026-03-20T12:20:00-04:00 ghci: Mention active language edition in startup banner Per GHC proposal 632, this makes the GHCi startup banner include the active language edition, plus an indication of whether this was the default (as opposed to being explicitly selected via an option such as `-XGHC2024`). For example: ``` $ ghci GHCi, version 9.14.1: https://www.haskell.org/ghc/ :? for help Using default language edition: GHC2024 ghci> ``` Fixes #26037. - - - - - 2 changed files: - ghc/GHCi/UI.hs - ghc/Main.hs Changes: ===================================== ghc/GHCi/UI.hs ===================================== @@ -23,7 +23,8 @@ module GHCi.UI ( GhciSettings(..), defaultGhciSettings, ghciCommands, - ghciWelcomeMsg + ghciWelcomeMsg, + languageEditionMsg ) where -- GHCi @@ -199,6 +200,10 @@ versionString = "GHCi, version " ++ cProjectVersion ghciWelcomeMsg :: String ghciWelcomeMsg = versionString ++ ": https://www.haskell.org/ghc/ :? for help" +languageEditionMsg :: Maybe Language -> String +languageEditionMsg Nothing = "Using default language edition: " ++ show defaultLanguage +languageEditionMsg (Just lang) = "Using language edition: " ++ show lang + ghciCommands :: [Command] ghciCommands = map mkCmd [ -- Hugs users are accustomed to :e, so make sure it doesn't overlap ===================================== ghc/Main.hs ===================================== @@ -37,7 +37,7 @@ import GHC.Platform import GHC.Platform.Host #if defined(HAVE_INTERNAL_INTERPRETER) -import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings ) +import GHCi.UI ( interactiveUI, ghciWelcomeMsg, defaultGhciSettings, languageEditionMsg ) #endif import GHC.Runtime.Loader ( loadFrontendPlugin, initializeSessionPlugins ) @@ -334,7 +334,9 @@ showBanner _postLoadMode dflags = do #if defined(HAVE_INTERNAL_INTERPRETER) -- Show the GHCi banner - when (isInteractiveMode _postLoadMode && verb >= 1) $ putStrLn ghciWelcomeMsg + when (isInteractiveMode _postLoadMode && verb >= 1) $ + do putStrLn ghciWelcomeMsg + putStrLn $ languageEditionMsg (language dflags) #endif -- Display details of the configuration in verbose mode View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e34cb6da7b980e2ccba320c38006abc0... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/e34cb6da7b980e2ccba320c38006abc0... You're receiving this email because of your account on gitlab.haskell.org.
participants (1)
-
Marge Bot (@marge-bot)