Encountering error while adding MaybeT dependency in stack project

不羁的心 提交于 2019-12-02 05:30:05

问题


I am following this tutorial webScrapper using HXT. I am using Stack here.

While adding dependency for MaybeT, it asked to:

Recommended action: try adding the following to your extra-deps in /Users/***/Haskell Development/Scrapper/stack.yaml: - MaybeT-0.1.2

Now doing so to ended up with this message on running stack build:

In the dependencies for MaybeT-0.1.2: base-4.9.0.0 must match <4.8 (latest applicable is 4.7.0.2) needed due to Scrapper-0.1.0.0 -> MaybeT-0.1.2

Being new to Stack, I am unable to solve the problem, in my cabal file the the dependency:

  build-depends:       base >= 4.7 && < 5
                    ,  hxt
                    ,  url
                    ,  HTTP
                    ,  MaybeT

In stack.yaml

resolver: lts-7.12
extra-deps: [MaybeT-0.1.2]

What is it that I have missed. How can I solve this?


回答1:


The solution for your concrete problem is switching from the outdated MaybeT package to the MaybeT transformer offered by the transformers package in Control.Monad.Trans.Maybe.


That said, note that the version mismatch involves base. If you actually needed to use the MaybeT package, you would have to switch the Stack resolver to a snapshot such as lts-6.26, which uses base-4.8 or below (i.e. GHC 7.10.3 or below). base versions are coupled to GHC versions, and everything else depends on base, so there is no easy way of switching just base to an older version, as it might be possible, given some luck, with other packages.



来源:https://stackoverflow.com/questions/40979171/encountering-error-while-adding-maybet-dependency-in-stack-project

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