simplistic-generics-2.0.0: Generic programming without too many type classes
Safe HaskellNone
LanguageHaskell2010

Generics.Simplistic.Derive.Show

Description

Derives a generic show, for example

data MyList a = MyNil | MyCons { hd :: a, tl :: MyList a } deriving Generic

myListValue :: MyList Integer
myListValue = MyCons 1 (MyCons 2 (MyCons 3 MyNil))

instance Show a => Show (MyList a) where
  show = gshow

The code here was adapted from `generic-deriving` https://github.com/dreixel/generic-deriving/blob/master/src/Generics/Deriving/Show.hs

Documentation

gshow :: (Generic t, GShallow (Rep t), OnLeaves Show (Rep t)) => t -> String Source #

gshowsPrec :: (Generic t, GShallow (Rep t), OnLeaves Show (Rep t)) => Type -> Int -> t -> ShowS Source #