andrep / hoc

Automatically exported from code.google.com/p/hoc
8 stars 1 forks source link

GHC 6.12.1 compile failure due to TH changes #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Compile trunk as of 12-30-09 with GHC 6.12.1.

What is the expected output? What do you see instead?
Compile error:
[15 of 31] Compiling HOC.CannedCIFs   ( HOC/HOC/CannedCIFs.hs, 
dist/build/HOC/CannedCIFs.o )

HOC/HOC/CannedCIFs.hs:80:49:
    Couldn't match expected type `Name'
           against inferred type `TyVarBndr'
      Expected type: [(Name, Type)]
      Inferred type: [(TyVarBndr, b)]
    In the second argument of `lookup', namely `mapping'
    In the second argument of `fromMaybe', namely
        `(lookup name mapping)'

HOC/HOC/CannedCIFs.hs:125:31:
    Couldn't match expected type `Name'
           against inferred type `TyVarBndr'
      Expected type: [(Name, b)]
      Inferred type: [(TyVarBndr, b1)]
    In the second argument of `lookup', namely `mapping'
    In the expression: lookup name mapping

This appears to be due to:
data Type
= ForallT [Name] Cxt Type

changing to:
data Type 
= ForallT [TyVarBndr] Cxt Type

Along with this:
data TyVarBndr = PlainTV  Name            -- a
               | KindedTV Name Kind       -- (a :: k)
      deriving( Show, Eq, Data, Typeable )

data Kind = StarK                         -- '*'
          | ArrowK Kind Kind              -- k1 -> k2
      deriving( Show, Eq, Data, Typeable )

Original issue reported on code.google.com by bill.t...@gmail.com on 30 Dec 2009 at 7:03

GoogleCodeExporter commented 9 years ago
Other code that deals with TH runs into an issue where Cxt was changed from 
[Type] to [Pred] where Pred is 
normally ClassP Name [Type].

Asking on #haskell gave the answer that previous ConT <name> `AppT` <type1> 
`AppT` <type2> should be 
rewritten as: ClassP <name> [<type1>, <type2] for Cxts.

Original comment by bill.t...@gmail.com on 2 Jan 2010 at 4:42

GoogleCodeExporter commented 9 years ago
Issue 25 has been merged into this issue.

Original comment by aut...@gmail.com on 18 Jun 2010 at 12:44

GoogleCodeExporter commented 9 years ago
Fixed by applying a mixture of patches, one contributed by pedromartins.pt (see 
Issue 25) and one by Torsten Kemps-Benedix.

Original comment by aut...@gmail.com on 18 Jun 2010 at 12:47