44

This is probably a very dumb question, but I can't seem to find the answer...

Will Ness
  • 70,110
  • 9
  • 98
  • 181
Diego Saa
  • 1,426
  • 1
  • 13
  • 23

3 Answers3

45

To find which version my stack is using, I ran

$ stack ghc -- --version

and got

$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.0.2
mherzl
  • 5,624
  • 6
  • 34
  • 75
32

ghc --version did the trick on Ubuntu, thanks Karolis!

Edit: works on mac too (macOS Sierra 10.12.6)

Nick Brady
  • 6,084
  • 1
  • 46
  • 71
Diego Saa
  • 1,426
  • 1
  • 13
  • 23
6

Depending on your install method and architecture, some commands may differ. Some people may have several versions installed. Here is a selection of information that may be useful:

stack version

❯ stack --version
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2

ghc version (as noted by @mherzl)

❯ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.6.5

standard ghc version command

❯ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.8.1

cabal version

❯ cabal --version
cabal-install version 3.0.0.0
compiled using version 3.0.0.0 of the Cabal library

GHC's repl

❯ ghci --version
The Glorious Glasgow Haskell Compilation System, version 8.8.1

If using llvm with -fllvm flag

❯ llvm-gcc -v
Apple clang version 11.0.0 (clang-1100.0.33.16)
Target: x86_64-apple-darwin19.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Michael Treanor
  • 585
  • 8
  • 9