Haskell: install from source

First we need to determine the version of ghc to be installed. Newest version not always good. Since we are going to install ghc-mod as final destination, its dependence on ghc version shall be the final judge. Check this page for more info about version restriction.

To install haskell, first need to check documentation.

As it says, minimal installation includes ghc, cabal & stack. It also seems that stack & cabal are equal. And in some circumstances cabal is better than stack, so we choose cabal.

Directly install ghc from source takes time.. The prerequisites suggests:

<Quote>

In general, we support building with the previous 2 major releases, e.g.:

  • To build 6.8.* you need GHC >= 6.4
  • To build 6.10.* you need GHC >= 6.6
  • To build 7.4.* you need GHC >= 7.0
  • To build 7.6.* you need GHC >= 7.2
  • To build 7.8.* you need GHC >= 7.4
  • To build 7.10.* you need GHC >= 7.6
  • To build 8.0.* you need GHC >= 7.8
  • To build 8.2.* you need GHC >= 7.10

</Quote>

Recursive building..

So in order to use the newest version of ghc, it seems we need first to get the very fresh binary of ghc and use it to build ghc from source .. all binary/sources can be found here.

Also build cabal from source needs ghc, and newest version of possible ghc is preferred, otherwise bugs might drive you crazy. And cabal repository seems been gfw-ed.

Using cabal to install ghc-mod, because it seems needed by haskell-completion vimscripts.

cabal can only install packages, cannot remove, if need to remove, first install a package called cabal-uninstall, then ~/.cabal/bin/cabal-uninstall shall uninstall packages.

转载于:https://www.cnblogs.com/sansna/p/7574209.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值