7

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)

Matt Fenwick
  • 48,199
  • 22
  • 128
  • 192
josejuan
  • 9,338
  • 24
  • 31
  • 1
    I don't understand why this was voted as not constructive. Is it because it may be construed as containing a criticism of haskell? This is a real problem facing haskell developers, and there are techniques known to experts that help. Please reopen. – luqui Oct 12 '12 at 04:05

2 Answers2

8

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.

Don Stewart
  • 137,316
  • 36
  • 365
  • 468
  • 1
    But a lot of packages are not part of the platform. – augustss Oct 11 '12 at 15:33
  • 1
    Sure. You use cabal with the platform to install additional packages The platform just fixes the GHC version, and platform library versions. It is then up to library authors to target the current released version. – Don Stewart Oct 11 '12 at 16:37
  • Yes, I use Haskell Platform but it not solve related problem (package/ghc version incompatibility). Eg. try to use cabal and problem occur (in certain cases). Thank you anyway. – josejuan Oct 12 '12 at 20:41
5

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.

mhwombat
  • 8,026
  • 28
  • 53
  • Thank you! Good ideas, which ghc (and/or haskell platform) have better balance or you suggest to start? Thank you. – josejuan Oct 12 '12 at 20:53
  • I second Don's recommendation to stick with the Haskell Platform. The current version has been out for quite a while, so it's likely that the packages you want are supported. – mhwombat Oct 14 '12 at 15:13