ThreadId gripe

Esa Ilari Vuokko eivuokko at
Tue Aug 22 17:53:44 EDT 2006

On 8/22/06, Frederik Eaton <frederik at> wrote:
> The 'Show' instance for ThreadId produces stuff like "ThreadId 1" -
> not very concise. Is there an simple way to turn it into an Int or
> Integer so I can call 'show' on that? Usually ThreadId's are turned
> into strings for the purpose of logging, in which case one really only
> wants the numeric part.

With GHC, you can do it the same way as it's done in base lib (maybe
not the simple you'd like, and might break between versions):

I do agree that the "ThreadId " part isn't that usefull.  Attached the trivial
patch to remove it from the Show instance, in case others agree.

Best regards,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: base-threadid-show.dpatch
Type: text/x-darcs-patch
Size: 28353 bytes
Desc: not available
Url :

More information about the Libraries mailing list