basvandijk committed 6f4e530

Fix for building Data.Aeson.TH with GHC-6.12.3.
When quoting an expression with a higher ranked type in GHC-6.12.3 like:

[e|V.create :: (forall s. GHC.ST.ST s (Data.Vector.Mutable.MVector s a))
-> Data.Vector.Vector a|] `appE` ...

the following error is thrown:

Cannot match a monotype with `(forall s.
GHC.ST.ST s (Data.Vector.Mutable.MVector s a))
-> Data.Vector.Vector a'
Probable cause: `V.create' is applied to too few arguments

The solution is not to quote the expression but to quote the name instead
and manually turn it into a variable.

  • Participants
  • Parent commits 2a5f6d3

Comments (0)

Files changed (1)

File Data/Aeson/TH.hs

                   ret = noBindS $ [e|return|] `appE` varE mv
               return $ [e|Array|] `appE`
-                         ([e|V.create|] `appE`
+                         (varE 'V.create `appE`
                            doE (newMV:stmts++[ret]))
     match (conP conName $ map varP args)
           (normalB $ withExp js)