[GHC] #11149: Unify fixity/associativity of <>-ish pretty-printing operators

GHC ghc-devs at haskell.org
Wed Dec 2 09:18:40 UTC 2015


#11149: Unify fixity/associativity of <>-ish pretty-printing operators
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                Owner:
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Compiler          |              Version:
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Description changed by hvr:

Old description:

> This ticket is motivated by GHC's new `-fwarn-semigroup`, and that `<>`
> is moving into `Prelude` with future GHCs.
>
> Throughout GHC's source there are related pretty-printing operators with
> subtly different `infixr/infixl`-declarations.
>
> It would be desirable to unify those and possibly use `Semigroup((<>))`
> instead (where `<>` represents a semigroup/monoid operation anyway)
>
> Otoh, existing code using `<>` assumes a different fixity, so it may make
> sense to start by renaming the unconventional `<>`s into something else.
>
> Modules affected:
>
>  - `Outputable` (ghc)
>  - `Pretty` (ghc)
>  - `Language.Haskell.TH.PprLib` (template-haskell)

New description:

 This ticket is motivated by GHC's new `-fwarn-semigroup`, and that `<>` is
 moving into `Prelude` with future GHCs.

 Throughout GHC's source there are related pretty-printing operators with
 subtly different `infixr/infixl`-declarations.

 It would be desirable to unify those and possibly use `Semigroup((<>))`
 instead (where `<>` represents a semigroup/monoid operation anyway)

 Otoh, existing code using `<>` assumes a different fixity
 (Monoid/Semigroup have `infixr 6 <>`), so it may make sense to start by
 renaming the unconventional `<>`s into something else.

 Modules affected:

  - `Outputable`: default fixity, i.e. `infixl 9` (ghc)
  - `Pretty`: `infixl 6` (ghc)
  - `Language.Haskell.TH.PprLib`: `infixl 6` (template-haskell)

 Related discussion: https://github.com/haskell/pretty/issues/30

--

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11149#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list