ghci: fixity declarations for infix data constructors (#10018)
authorThomas Miedema <thomasmiedema@gmail.com>
Tue, 21 Jul 2015 20:01:49 +0000 (22:01 +0200)
committerBen Gamari <ben@smart-cactus.org>
Thu, 23 Jul 2015 14:04:19 +0000 (16:04 +0200)
commite809ef57d841695f76ab9b2758f7aeb774d6b223
tree7861797e9a2b358b8a4dcd48e32cc821630cd917
parent608e76ced1ae2f8a9d2084d3092e37c47480fa91
ghci: fixity declarations for infix data constructors (#10018)

Declaring a custom fixity for an infix data constructor should work:

    Prelude> data Infix a b = a :@: b; infixl 4 :@:

This is a followup to #2947, which handled fixity declarations in ghci
statements (e.g. let add = (+); infixl 6 `add`).

Support for declarations (data, type, newtype, class, instance,
deriving, and foreign) was added to GHCi in #4929.

Reviewers: simonpj, austin, thomie

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D1028

GHC Trac Issues: #10018
compiler/main/HscMain.hs
compiler/main/HscTypes.hs
testsuite/tests/ghci/scripts/T10018.script [new file with mode: 0644]
testsuite/tests/ghci/scripts/T10018.stdout [new file with mode: 0644]
testsuite/tests/ghci/scripts/all.T