Hi! I’m trying to learn my way into a Haskell compiler, before I get into coding too much and get continuously interrupted by my lack of compiler knowledge.
I asked an AI to generate some basic code, knowing that usually LLMs do not try and compile their code, so that’s a great way to bump in all sorts of trouble. Gemini didn’t disappoint, and it also was quite helpful with the basic fixes and pointers. However, I got to a point in which both myself and Gemini cannot understand what’s going on.
It seems to mean that I’m using some library version that misses a method. Or is a conflicting declaration? Can anyone give me a hint?
Thanks!
2025-01-08 18:05:10.419229: [warn] llvm-hs-pure > Could not find module ‘Control.Monad.List’.
2025-01-08 18:05:10.419315: [warn] llvm-hs-pure > Perhaps you meant
2025-01-08 18:05:10.419403: [warn] llvm-hs-pure > Control.Monad.Fix (from base-4.19.2.0)
2025-01-08 18:05:10.419506: [warn] llvm-hs-pure > Control.Monad.Zip (from base-4.19.2.0)
2025-01-08 18:05:10.419590: [warn] llvm-hs-pure > Control.Monad.Base (needs flag -package-id transformers-base-0.4.6)
2025-01-08 18:05:10.419674: [warn] llvm-hs-pure > Use -v to see a list of the files searched for.
2025-01-08 18:05:10.419752: [warn] llvm-hs-pure > |
2025-01-08 18:05:10.419833: [warn] llvm-hs-pure > 27 | import Control.Monad.List
2025-01-08 18:05:10.421270: [warn] llvm-hs-pure > | ^^^^^^^^^^^^^^^^^^^^^^^^^
Control.Monad.List has been removed from mtl since version 2.3 because it was incorrect. You could add a < 2.3 upper bound to mtl, but really the best solution is to stop using that module.
to my llvm-hs-pure.cabal file doesn’t seem to have an impact, the error is unchanged.
On a parallel line… how would I know where a module can be found, if I have no idea that it supposed to come from mtl? I tried checking with hackage, but I haven’t found any obvious way.
The problem lies in one of your extra dependencies - llvm-hs-pure . As stated on hackage page it requires mtl (>=2.1 && <2.3), on the other hand in your stack.yaml file you declared the most recent LTS version (23.3) which comes with mtl-2.3.1. Also on llvm-hs-pure hackage page there is a note about library being tested with ghc ==8.0.2, ghc ==8.2.2, ghc ==8.4.4, ghc ==8.6.5.
How to proceed with that, harder way would be to refactor llvm-hs-pure to be compatible with newer libraries, easier just downgrade LTS version in stack.yaml file (14.27 or maybe something newer).