[GHC] #13743: Colourise command output

:i Int data <span style="color: red;font-weight: bold">Int</span> = I# E.Int# -- Defined in ‘GHC.Types’</br> instance <span style="font-weight: bold">Eq</span> <span style="color: red ;font-weight: bold">Int</span> -- Defined in ‘GHC.Classes’ instance <span style="font-weight: bold">Ord</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Classes’ instance <span style="font-weight: bold">Show</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Show’ instance <span style="font-weight: bold">Read</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Read’ instance <span style="font-weight: bold">Enum</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Enum’ instance <span style="font-weight: bold">Num</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Num’ instance <span style="font-weight: bold">Real</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Real’ instance [safe] <span style="font-weight: bold">NFData</span>
#13743: Colourise command output -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Our error messages are now colourful (#10073), can we do the same for the output of commands like `:info`? `:info` has gotten bloated (I also think the context / instance head should be swapped, but that's another story), adding colour would make it easier to read {{{#!html <pre> style="color: red;font-weight: bold">Int</span> -- Defined in ‘Control.DeepSeq’ instance <span style="font-weight: bold">Data</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘Data.Data’ instance <span style="font-weight: bold">Bounded</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Enum’ instance <span style="font-weight: bold">O.Outputable</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘Outputable’ instance [safe] <span style="font-weight: bold">PrintfArg</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘Text.Printf’ instance <span style="font-weight: bold">Integral</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Real’ </pre> }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13743 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13743: Colourise command output -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 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: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): TODO create a command to get a simplified output {{{#!html <pre>
:sinfo Int data <span style="color: red;font-weight: bold">Int</span> = I# E.Int# <span style="font-weight: bold">Eq</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Ord</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Show</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Read</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Enum</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Num</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Real</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">NFData</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Data</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Bounded</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Outputable</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">PrintfArg</span> <span style="color: red ;font-weight: bold">Int</span> <span style="font-weight: bold">Integral</span> <span style="color: red ;font-weight: bold">Int</span> </pre> }}}
-- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13743#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13743: Colourise command output -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8809 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * related: => #8809 Comment: #8809 is perhaps relevant here. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13743#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13743: Colourise command output -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8809 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): In general I think we should be careful in how we approach colorization in the compiler. I fear that adding a bunch of special cases will easily snowball into an unmaintainable mess as more and more users try to get their favorite case into the tree. We are already beginning to see this with requests like #13718. I would much rather have a general mechanism for integrating with GHCi, allowing users to more easily extend and customize its functionality. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13743#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

:i Int data <span style="color: red;font-weight: bold">Int</span> = I# E.Int# -- Defined in ‘GHC.Types’</br> instance <span style="font-weight: bold">Eq</span> <span style="color: red ;font-weight: bold">Int</span> -- Defined in ‘GHC.Classes’ instance <span style="font-weight: bold">Ord</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Classes’ instance <span style="font-weight: bold">Show</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Show’ instance <span style="font-weight: bold">Read</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Read’ instance <span style="font-weight: bold">Enum</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Enum’ instance <span style="font-weight: bold">Num</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Num’ instance <span style="font-weight: bold">Real</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Real’ instance [safe] <span style="font-weight: bold">NFData</span>
#13743: Colourise command output -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8809 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by Iceland_jack: @@ -9,1 +9,1 @@ - <pre> + <pre class="wiki"> New description: Our error messages are now colourful (#10073), can we do the same for the output of commands like `:info`? `:info` has gotten bloated (I also think the context / instance head should be swapped, but that's another story), adding colour would make it easier to read {{{#!html <pre class="wiki"> style="color: red;font-weight: bold">Int</span> -- Defined in ‘Control.DeepSeq’ instance <span style="font-weight: bold">Data</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘Data.Data’ instance <span style="font-weight: bold">Bounded</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Enum’ instance <span style="font-weight: bold">O.Outputable</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘Outputable’ instance [safe] <span style="font-weight: bold">PrintfArg</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘Text.Printf’ instance <span style="font-weight: bold">Integral</span> <span style="color: red;font-weight: bold">Int</span> -- Defined in ‘GHC.Real’ </pre> }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13743#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13743: Colourise command output -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: GHCi | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #8809 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): Replying to [comment:3 bgamari]:
I would much rather have a general mechanism for integrating with GHCi, allowing users to more easily extend and customize its functionality.
I'm all for that -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13743#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC