Skip to content
Snippets Groups Projects
Commit 1d43d4a3 authored by Nathan Collins's avatar Nathan Collins Committed by Marge Bot
Browse files

Improve ThreadId Show instance

By making it include parens when a derived instance would. For example, this changes the (hypothetical) code `show (Just (ThreadId 3))` to produce `"Just (ThreadId 3)"` instead of the current `"Just ThreadId 3"`.
parent 0e0d87da
No related branches found
No related tags found
No related merge requests found
......@@ -113,7 +113,7 @@ import GHC.IORef
import GHC.MVar
import GHC.Ptr
import GHC.Real ( fromIntegral )
import GHC.Show ( Show(..), showString )
import GHC.Show ( Show(..), showParen, showString )
import GHC.Stable ( StablePtr(..) )
import GHC.Weak
......@@ -145,7 +145,7 @@ This misfeature will hopefully be corrected at a later date.
-- | @since 4.2.0.0
instance Show ThreadId where
showsPrec d t =
showsPrec d t = showParen (d >= 11) $
showString "ThreadId " .
showsPrec d (getThreadId (id2TSO t))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment