emgm-0.3.1: Extensible and Modular Generics for the MassesSource codeContentsIndex
Generics.EMGM.Functions.Show
Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org
Description

Summary: Generic functions that convert values to readable strings.

The functions in this module involve generically producing a string from a value of a supported datatype. The functions showsPrec and show are modeled after those in the class Show, and shows after the related function of the same name.

The underlying unparser is designed to be as similar to deriving Show as possible. Refer to documentation in Text.Show for details.

Since this library does not have access to the syntax of a data declaration, it relies on ConDescr for information. It is important that ConDescr accurately describe, for each constructor, the name, arity, record labels (in same order as declared) if present, and fixity.

See also Generics.EMGM.Functions.Read.

Synopsis
newtype Show a = Show {
selShow :: ConType -> Int -> a -> ShowS
}
showsPrec :: Rep Show a => Int -> a -> ShowS
shows :: Rep Show a => a -> ShowS
show :: Rep Show a => a -> String
Documentation
newtype Show a Source
The type of a generic function that takes a constructor-type argument, a number (precedence), and a value and returns a ShowS function.
Constructors
Show
selShow :: ConType -> Int -> a -> ShowS
show/hide Instances
Generic Show
Rep Show String
Rep Show ()
Rep Show a => Rep Show ([] a)
(Rep Show a, Rep Show b) => Rep Show ((,) a b)
(Rep Show a, Rep Show b, Rep Show c) => Rep Show ((,,) a b c)
(Rep Show a, Rep Show b, Rep Show c, Rep Show d) => Rep Show ((,,,) a b c d)
(Rep Show a, Rep Show b, Rep Show c, Rep Show d, Rep Show e) => Rep Show ((,,,,) a b c d e)
(Rep Show a, Rep Show b, Rep Show c, Rep Show d, Rep Show e, Rep Show f) => Rep Show ((,,,,,) a b c d e f)
(Rep Show a, Rep Show b, Rep Show c, Rep Show d, Rep Show e, Rep Show f, Rep Show h) => Rep Show ((,,,,,,) a b c d e f h)
showsPrecSource
:: Rep Show a
=> IntOperator precedence of the enclosing context (a number from 0 to 11).
-> aThe value to be converted to a String.
-> ShowS
Convert a value to a readable string starting with the operator precedence of the enclosing context.
shows :: Rep Show a => a -> ShowSSource
A variant of showsPrec with the minimum precedence (0).
show :: Rep Show a => a -> StringSource
A variant of shows that returns a String instead of ShowS.
Produced by Haddock version 2.4.2