basic-sop-0.3.0: Basic examples and functions for generics-sop
Safe HaskellSafe-Inferred
LanguageHaskell2010

Generics.SOP.Show

Description

Generic show.

This module contains a generic show function defined using generics-sop.

Synopsis

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