Cannot build hledger-lib with Setup.hs/parsec 3 #22

simonmichael opened this Issue Apr 8, 2013 · 5 comments


None yet

1 participant


Original author: (August 11, 2010 02:37:49)

When attempting to build hledger-lib with Setup.hs, I get

~/.cabal/packages/ % ./Setup.hs build
Preprocessing library hledger-lib-0.11.1...
Building hledger-lib-0.11.1...
[ 1 of 17] Compiling Hledger.Data.Utils ( Hledger/Data/Utils.hs, dist/build/Hledger/Data/Utils.o )
[ 2 of 17] Compiling Hledger.Data.Types ( Hledger/Data/Types.hs, dist/build/Hledger/Data/Types.o )
[ 3 of 17] Compiling Hledger.Data.Dates ( Hledger/Data/Dates.hs, dist/build/Hledger/Data/Dates.o )

Couldn't match expected type ghc-prim:GHC.Prim.Any' against inferred typeChar'
Expected type: GenParser ghc-prim:GHC.Prim.Any u a
Inferred type: GenParser Char st SmartDate
In the expression: yyyymmdd
In the first argument of choice'', namely[yyyymmdd, ymd, ym, md, ....]'

However, it builds fine when I use cabal install; I can't figure out what cabal install is doing differently. (I am new at Haskell and was trying to compile hledger with profiling, as it runs really slowly on my ledger file.)

Original issue:


From on August 11, 2010 02:39:52
Oh, I should point out that this is a per-user install, though I also do the cabal installs in my user directory. So I ran ./Setup.hs configure --user.


From on August 11, 2010 15:39:15
Thanks for the report. It works for me with:

~/src/hledger-lib-0.11.1$ ghc-pkg list parsec


~/src/hledger-lib-0.11.1$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.3

I wonder if you have parsec 3 (if so, try ./Setup.hs configure --constraint 'parsec < 3') or if you have stale object files (try ./Setup.hs clean).


From on August 11, 2010 16:32:31
That fixed it, thanks! I have parsec 3 in the global ghc package database, and parsec 2 in the user database. I had to run

./Setup.hs configure --constraint 'parsec < 3' --package-db /home/massysett/.ghc/i386-linux-6.12.1/package.conf.d

otherwise Setup.hs would not find the parsec 2 in the user database.


From on August 11, 2010 16:42:33
Great. We should build with parsec 3 also, I'll keep this issue open.


From on August 12, 2010 14:43:53
Fixed by adding a type signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment