[GHC] #15156: Show instances for types exported from the ghc package

#15156: Show instances for types exported from the ghc package -------------------------------------+------------------------------------- Reporter: sjakobi | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 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: -------------------------------------+------------------------------------- In order to test and debug code that depends on the `ghc` package, it would be nice to have `Show` instances for the types it exports. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15156 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15156: Show instances for types exported from the ghc package -------------------------------------+------------------------------------- Reporter: sjakobi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 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 alexbiehl): While 'show' would be nice for now you can use 'ppr' and 'showSDocUnsafe' from 'Outputable'. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15156#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15156: Show instances for types exported from the ghc package -------------------------------------+------------------------------------- Reporter: sjakobi | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.2.2 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 sjakobi): Replying to [comment:1 alexbiehl]:
While 'show' would be nice for now you can use 'ppr' and 'showSDocUnsafe' from 'Outputable'.
Thanks for the tip, Alex! I had come accross `showSDocUnsafe` before, but was scared off by its documentation: {{{ -- showSDocUnsafe is unsafe, because `unsafeGlobalDynFlags` might not be -- initialised yet. }}} I felt like I had no reason to assume that `unsafeGlobalDynFlags` was initialised. The function might be less scary if there was a comment explaining under what circumstances `unsafeGlobalDynFlags` ''is'' initialised. For my immediate needs, I made do with a few orphan instances. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15156#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC