interface Show a where
show : a -> String
showsPrec : Nat -> a -> String
Convert a value to its String representation.
Two methods, mutually defaulting, so an instance need only give one:
show— the everyday "show me this value" (precedence 0).showsPrec d— show at surrounding precedenced, adding parentheses
when the value would otherwise be ambiguous (e.g. a constructor with arguments sitting inside another). By convention function application has precedence 10, so a field of a constructor is shown at 11: that is what makes Just (Just 3) print with the inner parentheses. Hand-written instances of atomic values just give show; the derived Show (and the compound instances below) give showsPrec for faithfulness.