Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Generic show.
This module contains a generic show function defined using
generics-sop
.
Synopsis
- gshowsPrec :: forall a. (Generic a, HasDatatypeInfo a, All2 Show (Code a)) => Int -> a -> ShowS
- gshow :: (Generic a, HasDatatypeInfo a, All2 Show (Code a)) => a -> String
Documentation
gshowsPrec :: forall a. (Generic a, HasDatatypeInfo a, All2 Show (Code a)) => Int -> a -> ShowS Source #
Generic show.
This function is a proof-of-concept implementation of a function
that is similar to the show
function you get by using
'deriving Show'.
It serves as an example of an SOP-style generic function that makes use of metadata.
If you want to use it on a datatype T
for which you have a
Generic
instance, you can use gshowsPrec
as
follows:
instance Show T where showsPrec = gshowsPrec