Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generic pretty-printer.
This module defines a generic function that helps in defining class
instances for the PrettyVal
class from the pretty-show
package.
- gprettyVal :: forall a. (Generic a, HasDatatypeInfo a, All2 PrettyVal (Code a)) => a -> Value
- class PrettyVal a where
Documentation
gprettyVal :: forall a. (Generic a, HasDatatypeInfo a, All2 PrettyVal (Code a)) => a -> Value Source
Generic pretty-printer.
This function turns a value into the uniform representation of type
Value
that is provided by the pretty-show
package. The function
has the suitable type to serve as the default implementation of the
prettyVal
function in the PrettyVal
class.
If you have a datatype T
that is an instance of generic-sop
's
Generic
and HasDatatypeInfo
classes, you can use gprettyVal
as follows:
instance PrettyVal T where prettyVal = gprettyVal
Re-exports
class PrettyVal a where
A class for types that may be reified into a value.
Instances of this class may be derived automatically,
for datatypes that support Generics
.
Nothing
PrettyVal Char | |
PrettyVal Double | |
PrettyVal Float | |
PrettyVal Int | |
PrettyVal Int8 | |
PrettyVal Int16 | |
PrettyVal Int32 | |
PrettyVal Int64 | |
PrettyVal Integer | |
PrettyVal Word8 | |
PrettyVal Word16 | |
PrettyVal Word32 | |
PrettyVal Word64 | |
PrettyVal a => PrettyVal [a] | |
(PrettyVal a, Integral a) => PrettyVal (Ratio a) | |
(PrettyVal a1, PrettyVal a2) => PrettyVal (a1, a2) | |
(PrettyVal a1, PrettyVal a2, PrettyVal a3) => PrettyVal (a1, a2, a3) | |
(PrettyVal a1, PrettyVal a2, PrettyVal a3, PrettyVal a4) => PrettyVal (a1, a2, a3, a4) | |
(PrettyVal a1, PrettyVal a2, PrettyVal a3, PrettyVal a4, PrettyVal a5) => PrettyVal (a1, a2, a3, a4, a5) | |
(PrettyVal a1, PrettyVal a2, PrettyVal a3, PrettyVal a4, PrettyVal a5, PrettyVal a6) => PrettyVal (a1, a2, a3, a4, a5, a6) | |
(PrettyVal a1, PrettyVal a2, PrettyVal a3, PrettyVal a4, PrettyVal a5, PrettyVal a6, PrettyVal a7) => PrettyVal (a1, a2, a3, a4, a5, a6, a7) |