Haskell, Hackage, GHC and productivity. What to do?

482 views Asked by At

For a year I've been a rookie haskeller ("rookie haskeller" forever, I think). I have coded little haskell programs (eg. a very simple snake game) but package dependencies and ghc failed versions is hard for me when I have to use certain libraries.

Selecting the correct ghc version is an art, I think.

Too new, and libraries fail (eg. yesod was updated to 7.4 recently; grapefruit-ui-gtk currently fails).

Too old, and libraries are obsolete and yet not supported.

HackageDB and its develeopers are fantastic, but I feel clumsy and don't know the correct way to develop a serious program.

What I must do? Am I too inexperienced? Is the hard way the only way?

(Excuse me if question is too general)

2

There are 2 answers

3
Don Stewart On

Stick to the Haskell Platform.

It exists to standardize a stable release of GHC over each 6 month period, so you don't have to guess which GHC to use.

2
mhwombat On

I don't think the problem you've described has anything to do with inexperience. This is just something that happens. Some suggestions:

As a general rule, don't upgrade your Haskell platform (or ghc) until you know that all of the packages you rely on support the new version. You can run multiple versions of the platform side-by-side if you want the latest and greatest, but also need to use an old version for some things.

Contact the maintainer, and ask when they're upgrading the package. Nine times out of ten, all they need to do is modify the cabal file, recompile, and re-upload. To find their email address, search hackage for the package name, and look for the word "Maintainer" in the banner.

As a dirty workaround: You can try modifying the the cabal file yourself (Tack on a ".1" to the end of the version number for the package to avoid version conflicts, and update the required version number for base), and then see if it compiles. I've done this successfully on a few occasions, and then sent an update to the maintainer using GitHub or whatever they're using.