For the instance to work, you need to implement at least one of show or showsPrec . In the class, there are default implementations of show using showsPrec (via shows ) and showsPrec using show :
showsPrec _ xs = show x ++ s show x = shows x ""
and
shows = showsPrec 0
So
instance Show T
creates an instance of the loop. A call to show calls showsPrec , which calls show , which ...
With the StandaloneDeriving language extension you can
ghci> :set -XStandaloneDeriving ghci> deriving instance Show T
print a copy at the invitation.
source share