Skip to content

Is KindSigOptions actually useful?  #81

@RyanGlScott

Description

@RyanGlScott

The example that is given in the Haddocks for how to use KindSigOptions is not terribly helpful:

* 'KindSigOptions': By default, all derived instances will use explicit kind
signatures (when the 'KindSigOptions' is 'True'). You might wish to set the
'KindSigOptions' to 'False' if you want a 'Generic'/'Generic1' instance at
a particular kind that GHC will infer correctly, but the functions in this
module won't guess correctly. For example, the following example will only
compile with 'KindSigOptions' set to 'False':
@
newtype Compose (f :: k2 -> *) (g :: k1 -> k2) (a :: k1) = Compose (f (g a))
$('deriveAll1Options' 'defaultOptions'{'kindSigOptions' = False} ''Compose)
@

Even if you generate code without explicit kind annotations in that example, it won't kind-check anyway due to other TH limitations mentioned here. If KindSigOptions isn't useful here, where is it useful? There are no examples in the test suite that make use of it, and I can't recall exactly why I needed it in the first place. We should either:

  1. Come up with an example where kindSigOptions = False is needed and document it, or
  2. Failing that, perhaps deprecate and/or remove KindSigOptions.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions