Haskell, Hackage, GHC and productivity. What to do? [closed]

醉酒当歌 提交于 2019-12-10 03:48:58

问题


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)


回答1:


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:


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.



来源:https://stackoverflow.com/questions/12841599/haskell-hackage-ghc-and-productivity-what-to-do

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!