Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is KindSigOptions actually useful? #81

Open
RyanGlScott opened this issue Oct 9, 2021 · 0 comments
Open

Is KindSigOptions actually useful? #81

RyanGlScott opened this issue Oct 9, 2021 · 0 comments

Comments

@RyanGlScott
Copy link
Collaborator

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.
RyanGlScott added a commit that referenced this issue Oct 9, 2021
The examples given to justify `KindSigOptions` are flawed, as they won't
kind-check even without explicit kind annotations. Until we can come up with
better examples to illustrate how to use `KindSigOptions` (see #81), let's
just remove these examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant