Skip to content

Commit

Permalink
Compatibility with Stackage lts-20.26 (GHC 9.2).
Browse files Browse the repository at this point in the history
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 ()
  • Loading branch information
nh2 committed Sep 29, 2023
1 parent 20a195c commit 0174f21
Show file tree
Hide file tree
Showing 29 changed files with 90 additions and 730 deletions.
4 changes: 2 additions & 2 deletions doc/ExampleExtractor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import qualified "bytestring" Data.ByteString as B
import qualified "bytestring" Data.ByteString.Lazy as BL
import "template-haskell" Language.Haskell.TH
import "template-haskell" Language.Haskell.TH.Syntax
import "this" Language.Haskell.Meta.Syntax.Translate ( toDecs )
import "haskell-src-meta" Language.Haskell.Meta.Syntax.Translate ( toDecs )

#if !MIN_VERSION_base(4,11,0)
import "base" Data.Monoid
Expand Down Expand Up @@ -269,7 +269,7 @@ mkRenderExampleImages renderTargets = [d|
where
doRender :: Exp
doRender =
DoE $ do
DoE Nothing $ do
rt <- renderTargets
let sym = VarE $ rtSymbolName rt
fp = LitE $ StringL $ "examples/" <> rtDestination rt
Expand Down
Loading

0 comments on commit 0174f21

Please sign in to comment.