1

I've copied the Aeson Template-Haskell module into a project of mine, and I'm trying to get it to compile. However, when I compile, I get the following error:

compiler/Elm/Haskelm/Json.hs:283:1:
parse error (possibly incorrect indentation or mismatched brackets)

That line uses the 'Name convention from Template-Haskell, so I think it's probably treating it as single-quotation marks instead of the Template-Haskell notation.

Why would it be doing this? At the beginning of my file, I have:

 {-# LANGUAGE CPP, FlexibleInstances, IncoherentInstances, NamedFieldPuns,
NoImplicitPrelude, OverlappingInstances, TemplateHaskell,
UndecidableInstances #-}

and in my Cabal file, I have

extensions: TemplateHaskell 
            MultiWayIf

but it's not treating the single quotes specially.

Note that, other than changing the Module name, the file I'm trying to compile is completely unchanged from the github one linked to.

jmite
  • 8,171
  • 6
  • 40
  • 81
  • 1
    It says the error is at column 1 of that line. That makes it much more likely the actual error is on a preceding line. – Carl Jan 07 '14 at 19:11
  • Which is `return $ [|Array|] \`appE\`` Still a TH issue maybe? – jmite Jan 07 '14 at 19:14
  • 1
    That line is *definitely* not syntactically valid. It ends with an infix operator, which is clearly a syntax error. – Carl Jan 07 '14 at 19:17
  • Good catch. I wonder if github is doing some weird line breaking. Clearly something is awry, since aeson is a mature library which seems to compile fine. – jmite Jan 07 '14 at 19:28
  • Yep, it's an indenting issue, it's fine at http://hackage.haskell.org/package/aeson-0.6.2.1/docs/src/Data-Aeson-TH.html . If you write this up as an answer I'll accept it. Thanks! – jmite Jan 07 '14 at 19:32
  • You might want to edit your question title, since it turns out to not be TH – misterbee Jan 07 '14 at 19:40

1 Answers1

2

That error message claims the problem is at column 1. That means that the previous line was probably the location of the real problem. Your followup in the comments indicates that the previous line was incomplete, and the line listed in the error message was supposed to be indented further to make it a continuation of the previous line.

Carl
  • 26,500
  • 4
  • 65
  • 86