-
Notifications
You must be signed in to change notification settings - Fork 51
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 ()
I'm archiving this repo in favour of haskell-party/haskell-src-meta. I'm a bit unclear on whether this PR is still relevant or whether it's made it to the other upstreams, but hopefully it shouldn't be too painful to move it if necessary? |
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').