Admin message

Due to a large amount of spam we do not allow new users to create repositories, they are "external" users. If you are a new user and want to create a repository, for example for forking GHC, open a new issue on ghc/ghc using the "get-verified" issue template

Template Haskell panic when splicing an infix expression with a non-variable middle bit
Simple enough: ``` import Language.Haskell.TH import Language.Haskell.TH.Syntax panic = $(let var = varE . mkName in infixApp (var "x") (appE (var "f") (var "y")) (var "z")) ``` ``` [1 of 1] Compiling Panic ( Panic.hs, interpreted ) ghc: panic! (the 'impossible' happened) (GHC version 7.0.1 for i386-unknown-linux): rnExpr: unexpected expression {6:11-92} f{v} y{v} x{v} z{v} Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug ``` Of course the expression being spliced doesn't make any sense. In fact, I'd think that the only things that make sense in the centre of an infix expression were a single variable or constructor, so that field being of type Exp is arguably way too permissiveP. haskell-src seems to have a data type especially for this purpose - `HsQOp` with constructors `HsQVarOp HsQName` and `HsQConOp HsQName`. <details><summary>Trac metadata</summary> | Trac field | Value | | ---------------------- | ---------------- | | Version | 7.0.1 | | Type | Bug | | TypeOfFailure | OtherFailure | | Priority | normal | | Resolution | Unresolved | | Component | Template Haskell | | Test case | | | Differential revisions | | | BlockedBy | | | Related | | | Blocking | | | CC | | | Operating system | | | Architecture | | </details> <!-- {"blocked_by":[],"summary":"Template Haskell panic when splicing an infix expression with a non-variable middle bit","status":"New","operating_system":"","component":"Template Haskell","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.0.1","keywords":[],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"Simple enough:\r\n\r\n{{{\r\nimport Language.Haskell.TH\r\nimport Language.Haskell.TH.Syntax\r\npanic = $(let var = varE . mkName in infixApp (var \"x\") (appE (var \"f\") (var \"y\")) (var \"z\"))\r\n}}}\r\n\r\n{{{\r\n[1 of 1] Compiling Panic ( Panic.hs, interpreted )\r\nghc: panic! (the 'impossible' happened)\r\n (GHC version 7.0.1 for i386-unknown-linux):\r\n\trnExpr: unexpected expression\r\n {6:11-92}\r\n f{v} y{v}\r\n x{v} z{v}\r\n\r\nPlease report this as a GHC bug: http://www.haskell.org/ghc/reportabug\r\n}}}\r\n\r\nOf course the expression being spliced doesn't make any sense. In fact, I'd think that the only things that make sense in the centre of an infix expression were a single variable or constructor, so that field being of type Exp is arguably way too permissiveP. haskell-src seems to have a data type especially for this purpose - `HsQOp` with constructors `HsQVarOp HsQName` and `HsQConOp HsQName`.","type_of_failure":"OtherFailure","blocking":[]} -->
issue