在ubuntu 12.04,ghc 7.10.3,cabal 1.22.3,4 gig的RAM上,按照these说明安装leksah时出错。
知道如何解决这个问题吗?是什么造成的?
joco@vm001:~$ cabal install leksah
Resolving dependencies...
Configuring regex-tdfa-text-1.0.0.2...
Building regex-tdfa-text-1.0.0.2...
Failed to install regex-tdfa-text-1.0.0.2
Build log ( /home/joco/.cabal/logs/regex-tdfa-text-1.0.0.2.log ):
Configuring regex-tdfa-text-1.0.0.2...
Building regex-tdfa-text-1.0.0.2...
Preprocessing library regex-tdfa-text-1.0.0.2...
[1 of 2] Compiling Text.Regex.TDFA.Text.Lazy ( Text/Regex/TDFA/Text/Lazy.hs, dist/build/Text/Regex/TDFA/Text/Lazy.o )
Text/Regex/TDFA/Text/Lazy.hs:77:9:
Non type-variable argument
in the constraint: Data.Array.Base.IArray a (Int, Int)
(Use FlexibleContexts to permit this)
When checking that ‘go’ has the inferred type
go :: forall t (a :: * -> * -> *) i.
(Functor (a i), Num i, GHC.Arr.Ix i,
Data.Array.Base.IArray a (Int, Int), Extract t) =>
Int -> t -> [a i (Int, Int)] -> [a i (t, (Int, Int))]
In the expression:
let
go i _ _ | i `seq` False = undefined
go _i _t [] = []
go i t (x : xs)
= let ... in fmap trans x : seq t' (go (off0 + len0) t' xs)
in go 0 source (matchAll regex source)
In an equation for ‘matchAllText’:
matchAllText regex source
= let
go i _ _ | i `seq` False = undefined
go _i _t [] = ...
go i t (x : xs) = ...
in go 0 source (matchAll regex source)
cabal: Error: some packages failed to install:
leksah-0.15.0.1 depends on regex-tdfa-text-1.0.0.2 which failed to install.
regex-tdfa-text-1.0.0.2 failed during the building phase. The exception was:
ExitFailure 1
joco@vm001:~$ cabal --version
cabal-install version 1.22.4.0
using version 1.22.3.0 of the Cabal library
joco@vm001:~$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.10.1
答案 0 :(得分:4)
执行命令
cabal install regex-tdfa-text --ghc-options=-XFlexibleContexts
然后再试一次。