deriving-compat-0.5.3: Backports of GHC deriving extensions

Text.Show.Deriving

Description

Exports functions to mechanically derive Show, Show1, and Show2 instances.

Synopsis

# Show

Generates a ShowClass instance declaration for the given data type or data family instance.

Like deriveShow, but takes a ShowOptions argument.

Generates a lambda expression which behaves like showsPrec (without requiring a ShowClass instance).

Like makeShowsPrec, but takes a ShowOptions argument.

Generates a lambda expression which behaves like show (without requiring a ShowClass instance).

Like makeShow, but takes a ShowOptions argument.

Generates a lambda expression which behaves like showList (without requiring a ShowClass instance).

Like makeShowList, but takes a ShowOptions argument.

# Show1

Generates a Show1 instance declaration for the given data type or data family instance.

Like deriveShow1, but takes a ShowOptions argument.

Generates a lambda expression which behaves like liftShowsPrec (without requiring a Show1 instance).

This function is not available with transformers-0.4.

Like makeLiftShowsPrec, but takes a ShowOptions argument.

This function is not available with transformers-0.4.

Generates a lambda expression which behaves like liftShowList (without requiring a ShowClass instance).

This function is not available with transformers-0.4.

Like makeLiftShowList, but takes a ShowOptions argument.

This function is not available with transformers-0.4.

Generates a lambda expression which behaves like showsPrec1 (without requiring a Show1 instance).

Like makeShowsPrec1, but takes a ShowOptions argument.

# Show2

Generates a Show2 instance declaration for the given data type or data family instance.

This function is not available with transformers-0.4.

Like deriveShow2, but takes a ShowOptions argument.

This function is not available with transformers-0.4.

Generates a lambda expression which behaves like liftShowsPrec2 (without requiring a Show2 instance).

This function is not available with transformers-0.4.

Like makeLiftShowsPrec2, but takes a ShowOptions argument.

This function is not available with transformers-0.4.

Generates a lambda expression which behaves like liftShowList2 (without requiring a ShowClass instance).

This function is not available with transformers-0.4.

Like makeLiftShowList2, but takes a ShowOptions argument.

This function is not available with transformers-0.4.

Generates a lambda expression which behaves like showsPrec2 (without requiring a Show2 instance).

This function is not available with transformers-0.4.

Like makeShowsPrec2, but takes a ShowOptions argument.

This function is not available with transformers-0.4.

# ShowOptions

Options that further configure how the functions in Text.Show.Deriving should behave.

Constructors

 ShowOptions Fieldsghc8ShowBehavior :: BoolIf True, the derived ShowClass, Show1, or Show2 instance will not surround the output of showing fields of unlifted types with parentheses, and the output will be suffixed with hash signs (#).showEmptyCaseBehavior :: BoolIf True, derived instances for empty data types (i.e., ones with no data constructors) will use the EmptyCase language extension. If False, derived instances will simply use seq instead. (This has no effect on GHCs before 7.8, since EmptyCase is only available in 7.8 or later.)
Instances
 Source # Instance detailsDefined in Text.Show.Deriving.Internal Methods Source # Instance detailsDefined in Text.Show.Deriving.Internal Methods Source # Instance detailsDefined in Text.Show.Deriving.Internal Methods Source # Instance detailsDefined in Text.Show.Deriving.Internal MethodsshowList :: [ShowOptions] -> ShowS #

ShowOptions that match the behavior of the most recent GHC release.

ShowOptions that match the behavior of the installed version of GHC.

# deriveShow limitations

Be aware of the following potential gotchas:

• Type variables of kind * are assumed to have Show constraints. Type variables of kind * -> * are assumed to have Show1 constraints. Type variables of kind * -> * -> * are assumed to have Show2 constraints. If this is not desirable, use makeShowsPrec or one of its cousins.
• The Show1 class had a different definition in transformers-0.4, and as a result, deriveShow1 implements different instances for the transformers-0.4 Show1 than it otherwise does. Also, makeLiftShowsPrec and makeLiftShowList are not available when this library is built against transformers-0.4, only 'makeShowsPrec1.
• The Show2 class is not available in transformers-0.4, and as a result, neither are Template Haskell functions that deal with Show2 when this library is built against transformers-0.4.