[HowTo] Fix Haskell compilation issues on Manjaro and other Arch-based distros

Difficulty : ★★★☆☆

This is quite an annoying problem and a lot of people have run into it, not being able to find a solution online, so I’m dropping this here.

The default ghc with dynamic libraries has some issues, including not being able to access basic modules.

Some errors include :-

Could not find module 'Prelude'
There are files missing in the ‘base-4.10.0.0’ package
Try running 'ghc-pkg check'

The fix is installing the ghc-static package. Optionally you can use the -dynamic flag while compiling, if you want the same dynamic libraries.

1 Like