λ>
What do I type within GHCi
to discover which GHC version it is using?
The version number of your copy of GHC can be found by invoking ghc with the --version flag (see Verbosity options).
In its default configuration, Stack will simply ignore any system GHC installation and use a sandboxed GHC that it has installed itself. You can find these sandboxed GHC installations in the ghc-* directories in the stack path --programs directory.
Open a command window and navigate to the directory where you want to keep your Haskell source files. Run Haskell by typing ghci or ghci MyFile. hs. (The "i" in "GHCi" stands for "interactive", as opposed to compiling and producing an executable file.)
> import System.Info
> :browse
arch :: String
compilerName :: String
compilerVersion :: Data.Version.Version
os :: String
> compilerVersion
Version {versionBranch = [8,10], versionTags = []}
> compilerName
"ghc"
On top of that, GHCi prints its version on startup:
GHCi, version 8.10.3: https://www.haskell.org/ghc/ :? for help
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With