Show Offs
When to derive Show?
The first Haskell system I used was Gofer which allowed anything to be shown. At some point its successor, Hugs switched to the proper Haskell system where the appropriate instances of the Show
class are needed to show anything.
Ever since I have religiously derived Show instance for almost all types so that I can see them in the REPL.
I am not alone, but also clearly not everyone agrees. Some packages export types that do not have Show
instances necessitating their derivation for simple REPL use in non-library contexts. For library contexts they will have to be wrapped in a newtype
first.
Being ever so selfish and narrow minded I am inclined to feel that maybe the Show
instances should be derived at source, but I am not sure whether this is reasonable. Are folks not deriving the Show types in case someone should think they are making use of the REPL, the Stupid Haskellers’ prop?
Got an issue with any of this? Please share or drop me a line (see below).