April 24, 2025

Haskell in 2025 - installing Haskell

I am running linux, namely Fedora 41 right now (April, 2025). There are a bunch of ghc packages available, so we do this:
dnf install ghc
This installs 70 packages! I also see ghc9.8 available in the fedora packages. After doing this, I type
ghci
GHCi, version 9.6.6: https://www.haskell.org/ghc/  :? for help
ghci>
So, I have ghc 9.6.6. I wonder why Fedora is not offering 9.8 as the default. Almost certainly there is a good reason,

I find a file "fibs.hs" in my Haskell directory with the following contents:

#!/usr/bin/runghc

-- fibs = 0:1: zipWith (+) fibs (tail fibs)
fibs = [0,1] ++ zipWith (+) fibs (tail fibs)

main = putStrLn $ show $ take 10 fibs
I run it via:
./fibs.hs
0,1,1,2,3,5,8,13,21,34]
This looks correct.

As one last thing I type "ghc fibs.hs" --

ghc fibs.hs
[1 of 2] Compiling Main             ( fibs.hs, fibs.o )
[2 of 2] Linking fibs
tom@trona:/u1/Projects/Haskell/2022$ ls
fibs  fibs.hi  fibs.hs  fibs.o  fsdir.hs
tom@trona:/u1/Projects/Haskell/2022$ ./fibs
[0,1,1,2,3,5,8,13,21,34]
So my install seems to work just fine.
Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org