简体   繁体   中英

Using Parsec with Yesod: cabal dependencies error

I want to use Parsec in a Yesod project but get a cabal error.

Here is what i added to my code:

import Text.ParserCombinators.Parsec

Got this error:

Could not find module `Text.ParserCombinators.Parsec'

So i added 'parsec' to my .cabal file and finally got this error:

cabal: Could not resolve dependencies:
trying: Blackbox-0.0.0 (user goal)
trying: parsec-3.1.3/installed-6a5... (dependency of Blackbox-0.0.0)
trying: warp-1.2.1.1/installed-638... (dependency of Blackbox-0.0.0)
next goal: network (dependency of warp-1.2.1.1/installed-638...)
rejecting: network-2.3.0.11/installed-b9c... (conflict:
parsec==3.1.3/installed-6a5..., network => parsec==3.1.2/installed-a67...)
rejecting: network-2.3.0.10/installed-e97... (package is broken)
rejecting: network-2.3.0.14, 2.3.0.13, 2.3.0.12, 2.3.0.11, 2.3.0.10, 2.3.0.9,
2.3.0.8, 2.3.0.7, 2.3.0.6, 2.3.0.5, 2.3.0.4, 2.3.0.3, 2.3.0.2, 2.3.0.1, 2.3,
2.2.1.10, 2.2.1.9, 2.2.1.8, 2.2.1.7, 2.2.1.6, 2.2.1.5, 2.2.1.4, 2.2.1.3,
2.2.1.2, 2.2.1.1, 2.2.1, 2.2.0.1, 2.2.0.0, 2.1.0.0, 2.0, 2.2.3.1, 2.2.3
(conflict: warp => network==2.3.0.11/installed-b9c...)

Any ideas what is going wrong here?

edit: It is a fresh Yesod install (including cabal update) and it worked before adding anything parsec related.

rm -Rf ~/.cabal && rm -Rf ~/.ghc

and reinstalling everything solved the problem.

I really wish i understood what's going on with installing haskell packages though...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM