Safe Haskell | None |
---|---|
Language | Haskell2010 |
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