0

I am a total Haskell beginner, and am going through the Hudak book Haskell School of Expression. I am working on the graphics chapter, and have found an updated version of the book's graphics library: https://github.com/noughtmare/haskell-school-of-expression. However, when I run cabal v1-build, I get

Resolving dependencies...
Warning: solver failed to find a solution:
Could not resolve dependencies:
[__0] trying: SOE-0.1.0.0 (user goal)
[__1] next goal: base (dependency of SOE)
[__1] rejecting: base-4.12.0.0/installed-4.12.0.0 (conflict: SOE => base>=4.13
&& <4.15)
[__1] fail (backjumping, conflict set: SOE, base)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: SOE, base
Trying configure anyway.
Configuring SOE-0.1.0.0...
cabal-3.6.2.0.exe: Encountered missing or private dependencies:
GLFW-b, base >=4.13 && <4.15, freetype2, old-time

I do know that base is just the Haskell Prelude, which I know I have, so I have no idea what to do here. Thanks!

ness64
  • 31
  • 6

1 Answers1

2

The specific error you're seeing occurs because the version of GHC you have installed is not compatible with that package.

The reason is that the base package version is locked to a specific GHC version, so you cannot use newer versions of base with older versions of GHC. See this wiki page for a list of the corresponding GHC version for each base version.

You could upgrade to a newer GHC version, such as 8.10.7.

An alternative is to run cabal with --allow-older=base.

And now I have actually updated the package to change the lower bound from 4.13 to 4.12, so it should compile fine if you pull the latest changes.

Also, I would recommend using the default v2-build, but that is not immediately related to the error you're seeing.

Noughtmare
  • 9,410
  • 1
  • 12
  • 38
  • Ah, I see. The only issue is that for my project, I need a package that only works with version 8.6.5. – ness64 Feb 28 '22 at 19:17
  • @Manfredian I've added another option to my answer. – Noughtmare Feb 28 '22 at 19:24
  • @Manfredian there's a good chance that the package in question also works with newer GHC, and just hasn't had its bounds upgraded in a while. On the other hand, if a package has a lower bound, it's likely because of somethis that _is_ needed and won't work. `--allow-newer` is thus generally speaking a better bet than `--allow-older`. – leftaroundabout Feb 28 '22 at 19:48
  • @leftaroundabout I'm the author of this package, I just picked this lower bound because GHC 8.8 was the oldest GHC I used at the time. – Noughtmare Feb 28 '22 at 20:04