Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

3 changed files:

Changes:

  • docs/users_guide/10.0.1-notes.rst
    1
    +.. _release-10-0-1:
    
    2
    +
    
    3
    +Version 10.0.1
    
    4
    +==============
    
    5
    +
    
    6
    +Language
    
    7
    +~~~~~~~~
    
    8
    +
    
    9
    +Compiler
    
    10
    +~~~~~~~~
    
    11
    +
    
    12
    +GHCi
    
    13
    +~~~~
    
    14
    +
    
    15
    +- Added the :ghci-cmd:`:version` command. This displays the current GHC version.
    
    16
    +
    
    17
    +Runtime system
    
    18
    +~~~~~~~~~~~~~~
    
    19
    +
    
    20
    +``base`` library
    
    21
    +~~~~~~~~~~~~~~~~
    
    22
    +
    
    23
    +``ghc-prim`` library
    
    24
    +~~~~~~~~~~~~~~~~~~~~
    
    25
    +
    
    26
    +``ghc`` library
    
    27
    +~~~~~~~~~~~~~~~
    
    28
    +
    
    29
    +``ghc-heap`` library
    
    30
    +~~~~~~~~~~~~~~~~~~~~
    
    31
    +
    
    32
    +``template-haskell`` library
    
    33
    +~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    34
    +
    
    35
    +Included libraries
    
    36
    +~~~~~~~~~~~~~~~~~~

  • docs/users_guide/ghci.rst
    ... ... @@ -3140,6 +3140,10 @@ commonly used commands.
    3140 3140
     
    
    3141 3141
         The :ghci-cmd:`:uses` command requires :ghci-cmd:`:set +c` to be set.
    
    3142 3142
     
    
    3143
    +.. ghci-cmd:: :version
    
    3144
    +
    
    3145
    +    Display the current GHC version.
    
    3146
    +
    
    3143 3147
     .. ghci-cmd:: :where
    
    3144 3148
     
    
    3145 3149
        Show the current evaluation stack while stopped at a breakpoint.
    

  • ghc/GHCi/UI.hs
    ... ... @@ -193,9 +193,11 @@ defaultGhciSettings =
    193 193
             fullHelpText      = defFullHelpText
    
    194 194
         }
    
    195 195
     
    
    196
    +versionString :: String
    
    197
    +versionString = "GHCi, version " ++ cProjectVersion
    
    198
    +
    
    196 199
     ghciWelcomeMsg :: String
    
    197
    -ghciWelcomeMsg = "GHCi, version " ++ cProjectVersion ++
    
    198
    -                 ": https://www.haskell.org/ghc/  :? for help"
    
    200
    +ghciWelcomeMsg = versionString ++ ": https://www.haskell.org/ghc/  :? for help"
    
    199 201
     
    
    200 202
     ghciCommands :: [Command]
    
    201 203
     ghciCommands = map mkCmd [
    
    ... ... @@ -253,6 +255,7 @@ ghciCommands = map mkCmd [
    253 255
       ("unadd",     keepGoingPaths unAddModule,     completeFilename),
    
    254 256
       ("undef",     keepGoing undefineMacro,        completeMacro),
    
    255 257
       ("unset",     keepGoing unsetOptions,         completeSetOptions),
    
    258
    +  ("version",   keepGoing showVersion',         noCompletion),
    
    256 259
       ("where",     keepGoing whereCmd,             noCompletion),
    
    257 260
       ("instances", keepGoing' instancesCmd,        completeExpression)
    
    258 261
       ] ++ map mkCmdHidden [ -- hidden commands
    
    ... ... @@ -366,6 +369,7 @@ defFullHelpText =
    366 369
       "   :type +d <expr>             show the type of <expr>, defaulting type variables\n" ++
    
    367 370
       "   :unadd <module> ...         remove module(s) from the current target set\n" ++
    
    368 371
       "   :undef <cmd>                undefine user-defined command :<cmd>\n" ++
    
    372
    +  "   :version                    display the current GHC version\n" ++
    
    369 373
       "   ::<cmd>                     run the builtin command\n" ++
    
    370 374
       "   :!<command>                 run the shell command <command>\n" ++
    
    371 375
       "   :shell <command>            run shell via sh -c <command>\n" ++
    
    ... ... @@ -3626,6 +3630,9 @@ unsetOptions str
    3626 3630
                  no_flags <- mapM no_flag minus_opts
    
    3627 3631
                  when (not (null no_flags)) $ newDynFlags False no_flags
    
    3628 3632
     
    
    3633
    +showVersion' :: GhciMonad m => String -> m ()
    
    3634
    +showVersion' _ = liftIO (putStrLn versionString)
    
    3635
    +
    
    3629 3636
     isMinus :: String -> Bool
    
    3630 3637
     isMinus ('-':_) = True
    
    3631 3638
     isMinus _ = False