-
Notifications
You must be signed in to change notification settings - Fork 51
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
Support DataKinds #54
base: master
Are you sure you want to change the base?
Conversation
- Removed dependency on custom version of haskell-src-meta - Can be undone once issue with haskell-src-meta is resolved (bmillwood/haskell-src-meta#54)
@roelvandijk I've taken over the package. This PR is very old and currently has a merge conflict, so I've not attempted to pull it into the new release yet. (Well, I did attempt it, but I ran into issues with ghc complaining about the DataKinds pragma not being there, even though it was there, so I abandoned my efforts for now.) If you'd like to open a fresh PR on the forked repo, please feel free. https://github.com/DanBurton/haskell-src-meta |
We just copy+pasted that module into our project: https://github.com/LumiGuide/haskell-opencv/blob/master/doc/Language/Haskell/Meta/Syntax/Translate.hs It has received some patches in the last 3 years. Feel free to use it for inspiration, or just copy+paste it back into haskell-src-meta. If I have some free time I could take a look at the differences between both files and maybe make a nice up-to-date pull request. |
The main task here is to make `doc-images-opencv` work, which is this package's way to generate nice documentation images into the Haddocks, from code that's in the Haddocks. For that, this commit: * Deletes copy-pasted + modified module from `haskell-src-meta`, `Language.Haskell.Meta.Syntax.Translate`, since as per the commit mentioned in * bmillwood/haskell-src-meta#54 * haskell-party/haskell-src-meta#3 (comment) * haskell-party/haskell-src-meta@5c69c3a the necessary `DataKinds` changes were merged upstream. The commit suggests it's in >= 0.8.3, so that's what's added in the `.cabal` file. * Replaces all occurrences of `*` by `Type` from `Data.Kind` to fix all `-Wstar-is-type` warnings (see also https://ghc-proposals.readthedocs.io/en/latest/proposals/0143-remove-star-kind.html). This is necessary because the upstream `haskell-src-meta` above does not support `*` but does support `Type`; it would print: Language.Haskell.Meta.Syntax.Translate.toType: not implemented: TyStar ()
The main task here is to make `doc-images-opencv` work, which is this package's way to generate nice documentation images into the Haddocks, from code that's in the Haddocks. For that, this commit: * Deletes copy-pasted + modified module from `haskell-src-meta`, `Language.Haskell.Meta.Syntax.Translate`, since as per the commit mentioned in * bmillwood/haskell-src-meta#54 * haskell-party/haskell-src-meta#3 (comment) * haskell-party/haskell-src-meta@5c69c3a the necessary `DataKinds` changes were merged upstream. The commit suggests it's in >= 0.8.3, so that's what's added in the `.cabal` file. * Replaces all occurrences of `*` by `Type` from `Data.Kind` to fix all `-Wstar-is-type` warnings (see also https://ghc-proposals.readthedocs.io/en/latest/proposals/0143-remove-star-kind.html). This is necessary because the upstream `haskell-src-meta` above does not support `*` but does support `Type`; it would print: Language.Haskell.Meta.Syntax.Translate.toType: not implemented: TyStar ()
Relevant fix: haskell-party#3 (comment) I found that handling So by simply fixing all I guess whether to keep this issue open depends on whether you'd like to support the (now-legacy) |
The main task here is to make `doc-images-opencv` work, which is this package's way to generate nice documentation images into the Haddocks, from code that's in the Haddocks. For that, this commit: * Deletes copy-pasted + modified module from `haskell-src-meta`, `Language.Haskell.Meta.Syntax.Translate`, since as per the commit mentioned in * bmillwood/haskell-src-meta#54 * haskell-party/haskell-src-meta#3 (comment) * haskell-party/haskell-src-meta@5c69c3a the necessary `DataKinds` changes were merged upstream. The commit suggests it's in >= 0.8.3, so that's what's added in the `.cabal` file. * Replaces all occurrences of `*` by `Type` from `Data.Kind` to fix all `-Wstar-is-type` warnings (see also https://ghc-proposals.readthedocs.io/en/latest/proposals/0143-remove-star-kind.html). This is necessary because the upstream `haskell-src-meta` above does not support `*` but does support `Type`; it would print: Language.Haskell.Meta.Syntax.Translate.toType: not implemented: TyStar ()
The main task here is to make `doc-images-opencv` work, which is this package's way to generate nice documentation images into the Haddocks, from code that's in the Haddocks. For that, this commit: * Deletes copy-pasted + modified module from `haskell-src-meta`, `Language.Haskell.Meta.Syntax.Translate`, since as per the commit mentioned in * bmillwood/haskell-src-meta#54 * haskell-party/haskell-src-meta#3 (comment) * haskell-party/haskell-src-meta@5c69c3a the necessary `DataKinds` changes were merged upstream. The commit suggests it's in >= 0.8.3, so that's what's added in the `.cabal` file. * Replaces all occurrences of `*` by `Type` from `Data.Kind` to fix all `-Wstar-is-type` warnings (see also https://ghc-proposals.readthedocs.io/en/latest/proposals/0143-remove-star-kind.html). This is necessary because the upstream `haskell-src-meta` above does not support `*` but does support `Type`; it would print: Language.Haskell.Meta.Syntax.Translate.toType: not implemented: TyStar ()
The main task here is to make `doc-images-opencv` work, which is this package's way to generate nice documentation images into the Haddocks, from code that's in the Haddocks. For that, this commit: * Deletes copy-pasted + modified module from `haskell-src-meta`, `Language.Haskell.Meta.Syntax.Translate`, since as per the commit mentioned in * bmillwood/haskell-src-meta#54 * haskell-party/haskell-src-meta#3 (comment) * haskell-party/haskell-src-meta@5c69c3a the necessary `DataKinds` changes were merged upstream. The commit suggests it's in >= 0.8.3, so that's what's added in the `.cabal` file. * Replaces all occurrences of `*` by `Type` from `Data.Kind` to fix all `-Wstar-is-type` warnings (see also https://ghc-proposals.readthedocs.io/en/latest/proposals/0143-remove-star-kind.html). This is necessary because the upstream `haskell-src-meta` above does not support `*` but does support `Type`; it would print: Language.Haskell.Meta.Syntax.Translate.toType: not implemented: TyStar ()
The main task here is to make `doc-images-opencv` work, which is this package's way to generate nice documentation images into the Haddocks, from code that's in the Haddocks. For that, this commit: * Deletes copy-pasted + modified module from `haskell-src-meta`, `Language.Haskell.Meta.Syntax.Translate`, since as per the commit mentioned in * bmillwood/haskell-src-meta#54 * haskell-party/haskell-src-meta#3 (comment) * haskell-party/haskell-src-meta@5c69c3a the necessary `DataKinds` changes were merged upstream. The commit suggests it's in >= 0.8.3, so that's what's added in the `.cabal` file. * Replaces all occurrences of `*` by `Type` from `Data.Kind` to fix all `-Wstar-is-type` warnings (see also https://ghc-proposals.readthedocs.io/en/latest/proposals/0143-remove-star-kind.html). This is necessary because the upstream `haskell-src-meta` above does not support `*` but does support `Type`; it would print: Language.Haskell.Meta.Syntax.Translate.toType: not implemented: TyStar ()
Necessary if you want to translate Haskell code using the DataKinds language extension.
Note that a small hack was needed to translate a HSE KindVar to template haskell. HSE does not seem to be able to distinguish between kind variables (such as 'k') and kind constructors (such as 'Nat').