Is there no standard way to print out values for end-user consumption? Show
is clearly more of a debugging convenience than something that would work for this purpose, given the conventions around its use and the constraint that read (show x) == x
.
For example, isn't there at least a simple package like
class (Show a) => PShow a where
pshow :: a -> String
pshow = show
pprint :: (PShow a) => a -> IO ()
pprint = putStrLn . pshow
where instances do something like
instance PShow MyType where
pshow a = someUserFriendlyStringOf a
Note that I'm not asking for something that provides elaborate pretty printing and formatting functionality (I see several packages that do that) just for a simple abstraction that's widely used that allows for pretty printing. Is there something like this?