Changing GHC Error Message Wrapping

Simon Peyton-Jones simonpj at microsoft.com
Mon Jan 6 12:44:58 UTC 2014


I think it's line 705 in types/TypeRep.lhs

pprTcApp p pp tc tys
  | isTupleTyCon tc && tyConArity tc == length tys
  = pprPromotionQuote tc <>
    tupleParens (tupleTyConSort tc) (sep (punctuate comma (map (pp TopPrec) tys)))

If you change 'sep' to 'fsep', you'll get behaviour more akin to paragraph-filling (hence the "f").   Give it a try.  You'll get validation failure from the testsuite, but you can see whether you think the result is better or worse.  In general, should multi-line tuples be printed with many elements per line, or just one?

Simon

From: ghc-devs [mailto:ghc-devs-bounces at haskell.org] On Behalf Of Andrew Gibiansky
Sent: 04 January 2014 17:30
To: Erik de Castro Lopo
Cc: ghc-devs at haskell.org
Subject: Re: Changing GHC Error Message Wrapping

Apologize for the broken image formatting.

With the code I posted above, I get the following output:

Couldn't match expected type `(GHC.Types.Int<http://GHC.Types.Int>,
                               GHC.Types.Int<http://GHC.Types.Int>,
                               GHC.Types.Int<http://GHC.Types.Int>,
                               t0,
                               t10,
                               t20,
                               t30,
                               t40,
                               t50,
                               t60,
                               t70,
                               t80,
                               t90)'
            with actual type `(t1, t2, t3)'

I would like the types to be on the same line, or at least wrapped to a larger number of columns.

Does  anyone know how to do this, or where in the GHC source this wrapping is done?

Thanks!
Andrew

On Sat, Jan 4, 2014 at 2:55 AM, Erik de Castro Lopo <mle+hs at mega-nerd.com<mailto:mle+hs at mega-nerd.com>> wrote:
Carter Schonwald wrote:

> hey andrew, your image link isn't working (i'm using gmail)
I think the list software filters out image attachments.

Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
_______________________________________________
ghc-devs mailing list
ghc-devs at haskell.org<mailto:ghc-devs at haskell.org>
http://www.haskell.org/mailman/listinfo/ghc-devs

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140106/d04466b1/attachment.html>


More information about the ghc-devs mailing list