【问题标题】:Cannot install lens with haste-inst不能用急速安装镜头
【发布时间】:2015-05-12 06:03:46
【问题描述】:

我正在尝试安装 lens 包以使用 haskell。

$ haste-inst install lens

我收到以下错误:

Resolving dependencies...
cabal: Could not resolve dependencies:
trying: base-4.6.0.1/installed-4.6... (user goal)
trying: containers-0.4.1.0/installed- (user goal)
trying: lens-4.9.1 (user goal)
next goal: template-haskell (dependency of lens-4.9.1)
rejecting: template-haskell-2.10.0.0 (conflict:
base==4.6.0.1/installed-4.6..., template-haskell => base==4.8.*)
rejecting: template-haskell-2.9.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.7.*)
rejecting: template-haskell-2.8.0.0 (conflict: containers==0.4.1.0/installed-,
template-haskell => containers==0.5.*)
rejecting: template-haskell-2.7.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.5.*)
rejecting: template-haskell-2.6.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.4.*)
rejecting: template-haskell-2.5.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.3.*)
rejecting: template-haskell-2.4.0.1 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base==4.2.*)
rejecting: template-haskell-2.4.0.0 (conflict: base==4.6.0.1/installed-4.6...,
template-haskell => base>=3 && <4.3)
rejecting: template-haskell-2.3.0.1, 2.3.0.0, 2.2.0.0 (conflict: lens =>
template-haskell>=2.4 && <2.11)
Backjump limit reached (change with --max-backjumps).

Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.

我认为沙盒“注意”具有误导性。沙盒是新的,base 无论如何都不能存在于沙盒中。

是什么决定了加速基地的版本?用 cabal(对于 haskell)安装镜头效果很好:

cabal install lens

编辑:

lens-family 到目前为止作为替代品效果很好。

【问题讨论】:

  • 哦,我明白了,here's what determines the version of haste's version of base - 基础是从原始代码库中合并和修补的。
  • 所以“明显”的问题是支持提供的基本包的模板 haskell 版本不支持已安装的容器包。看来我不允许在沙箱内重新安装。在外面它似乎工作..
  • 嗯,我认为解决方案是在匆忙时避免沙箱。我稍后再试。
  • 为什么要安装容器 0.4.1.0?您肯定想要至少 0.5.0.0,这是 GHC 7.6 附带的版本吗?
  • 不要安装任何容器包,只用GHC自带的那个。 (或者是急速,我猜...不确定包管理如何与急速一起工作,但一般来说,您应该只使用编译器附带的模板-haskell,并且由于容器是模板-haskell 的依赖项,因此同样适用容器。)

标签: haskell haskell-lens haste


【解决方案1】:

Lens 依赖于 Template Haskell,不幸的是,Haste 目前不支持该模板。

目前为 Haste 实现 base 的方式使 TH 支持变得棘手。但是,无论如何,GHC 7.10 支持都需要进行一些重大改组,因此 TH 支持可能会与 7.10 一起到来。

【讨论】:

  • 我明白了。似乎获得镜头的最佳选择是然后尝试lens-family。更多的手动工作,但依赖项更加简约。
  • 现在深入了解我的项目。到目前为止,lens-family 似乎工作得很好。 (我不得不自己制作一些镜片,以更好地理解镜片。)
  • 出于其他目的,我想了一下是否可以解决不支持 TH 的问题。以下是一些潜在的线索:12
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2016-06-10
  • 1970-01-01
  • 2020-08-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多