我的环境:
- 来自http://ghcformacosx.github.io/的ghc 7.8.3
- OSX 10.9.5
- cabal 1.20.0.3(直接从ghc for mac osx获取)
我执行了cabal install alex
和cabal install happy
。确认cabal二进制路径已添加到我的$PATH中,路径为$(HOME)/Library/Haskell/bin/
。
cabal install haskell-src-exts
出现了以下编译错误:
[19 of 22] Compiling Language.Haskell.Exts.InternalParser ( dist/build/Language/Haskell/Exts/InternalParser.hs, dist/build/Language/Haskell/Exts/InternalParser.o )
templates/GenericTemplate.hs:104:22:
Couldn't match expected type ‘Bool’
with actual type ‘Happy_GHC_Exts.Int#’
In the expression:
(n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#))
In a stmt of a pattern guard for
a case alternative:
(n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#))
In a case alternative:
n | (n Happy_GHC_Exts.<# (0# :: Happy_GHC_Exts.Int#))
-> (happyReduceArr Happy_Data_Array.! rule) i tk st
where
rule
= (Happy_GHC_Exts.I#
((Happy_GHC_Exts.negateInt#
((n Happy_GHC_Exts.+# (1# :: Happy_GHC_Exts.Int#))))))
templates/GenericTemplate.hs:115:23:
Couldn't match expected type ‘Bool’
with actual type ‘Happy_GHC_Exts.Int#’
In the expression:
(off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#))
In the expression:
if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#)) then
(indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)
else
False
In an equation for ‘check’:
check
= if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#)) then
(indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)
else
False
templates/GenericTemplate.hs:117:30:
Couldn't match expected type ‘Happy_GHC_Exts.Int#’
with actual type ‘Bool’
In the expression: False
In the expression:
if (off_i Happy_GHC_Exts.>=# (0# :: Happy_GHC_Exts.Int#)) then
(indexShortOffAddr happyCheck off_i Happy_GHC_Exts.==# i)
else
False
templates/GenericTemplate.hs:119:13:
Couldn't match expected type ‘Bool’
with actual type ‘Happy_GHC_Exts.Int#’
In the expression: check
In a stmt of a pattern guard for
a pattern binding:
check
templates/GenericTemplate.hs:212:14:
Pattern bindings containing unlifted types should use an outermost bang pattern:
(sts1@((HappyCons (st1@(action)) (_))))
= happyDrop k (HappyCons (st) (sts))
In an equation for ‘happyMonadReduce’:
happyMonadReduce k nt fn j tk st sts stk
= happyThen1
(fn stk tk)
(\ r -> happyGoto nt j tk st1 sts1 (r `HappyStk` drop_stk))
where
(sts1@((HappyCons (st1@(action)) (_))))
= happyDrop k (HappyCons (st) (sts))
drop_stk = happyDropStk k stk
templates/GenericTemplate.hs:219:14:
Pattern bindings containing unlifted types should use an outermost bang pattern:
(sts1@((HappyCons (st1@(action)) (_))))
= happyDrop k (HappyCons (st) (sts))
In an equation for ‘happyMonad2Reduce’:
happyMonad2Reduce k nt fn j tk st sts stk
= happyThen1
(fn stk tk)
(\ r -> happyNewToken new_state sts1 (r `HappyStk` drop_stk))
where
(sts1@((HappyCons (st1@(action)) (_))))
= happyDrop k (HappyCons (st) (sts))
drop_stk = happyDropStk k stk
(off) = indexShortOffAddr happyGotoOffsets st1
(off_i) = (off Happy_GHC_Exts.+# nt)
....
Failed to install haskell-src-exts-1.16.0
cabal: Error: some packages failed to install:
haskell-src-exts-1.16.0 failed during the building phase. The exception was:
ExitFailure 1