I'm running into a compatibility problem trying to cabal install agda
using GHC 7.8.3 and Cabal 1.16.0.2, on Ubuntu 14.04.
The problem appears to be with haskell-src-exts-1.15.0.1
, which Agda requires. Compiling that library runs into the following well-known problem caused (I believe) by Happy-generated code being incompatible with a change to GHC in version 7.8.
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#))))))
The article mentioned above describes how to clean and rebuild a library that contains incompatible Happy-generated code. However, I couldn't make this work for haskell-src-exts-1.15.0.1. In particular, trying
cabal unpack haskell-src-exts-1.15.0.1
cd haskell-src-exts-1.15.0.1
cabal clean
cabal install
runs into the same problem.
Any suggestions?