codedownio / aeson-typescript

Generate TypeScript definition files from your ADTs
BSD 3-Clause "New" or "Revised" License
59 stars 27 forks source link

Cut a new version to fix GHC 9.6 compilation errors #38

Closed hdgarrood closed 1 year ago

hdgarrood commented 1 year ago

Building 0.5.0.0 with GHC 9.6 and cabal causes these errors:

src/Data/Aeson/TypeScript/Recursive.hs:64:3: error: [GHC-88464]
    Variable not in scope:
      forM_ :: [Name] -> (Name -> WriterT w Q ()) -> WriterT w Q a2
   |
64 |   forM_ names $ \n -> deriveInstanceIfNecessary n deriveFn
   |   ^^^^^

src/Data/Aeson/TypeScript/Recursive.hs:81:5: error: [GHC-88464]
    Variable not in scope: when :: Bool -> m1 a3 -> MaybeT Q a4
   |
81 |     when (datatypeVars /= []) $ fail ""
   |     ^^^^

src/Data/Aeson/TypeScript/Recursive.hs:102:17: error: [GHC-88464]
    Variable not in scope: unless :: Bool -> StateT [Name] Q () -> m b
    |
102 |                 unless (n `L.elem` st) $ do
    |                 ^^^^^^

src/Data/Aeson/TypeScript/Recursive.hs:106:11: error: [GHC-88464]
    Variable not in scope:
      forM_ :: [Type] -> (Type -> t2) -> StateT [Name] Q ()
    |
106 |           forM_ parentTypes $ \typ -> do
    |           ^^^^^

src/Data/Aeson/TypeScript/Recursive.hs:108:13: error: [GHC-88464]
    Variable not in scope: forM_ :: [Name] -> (Name -> m0 b0) -> t2
    |
108 |             forM_ names maybeRecurse
    |             ^^^^^

src/Data/Aeson/TypeScript/Recursive.hs:119:7: error: [GHC-88464]
    Variable not in scope:
      unless
        :: Bool
           -> StateT ([Name], [Type]) Data.Functor.Identity.Identity ()
           -> m a1
    |
119 |       unless (t1 `L.elem` visitedTypes) $ do
    |       ^^^^^^

src/Data/Aeson/TypeScript/Recursive.hs:124:7: error: [GHC-88464]
    Variable not in scope:
      unless
        :: Bool
           -> StateT ([Name], [Type]) Data.Functor.Identity.Identity () -> m b
    |
124 |       unless (t2 `L.elem` visitedTypes') $ do
    |       ^^^^^^

I'm a bit confused about how this happens, since it seems like 5ae6687ba09c609c6698ef06ad6b3dac490395d1 should fix this, and that commit is a parent of 5ef8e5507cbef37eb89a8e4d2c0c667dec931d16, which is v0.5.0.0??? But somehow I'm seeing these errors on v0.5.0.0 and not on master. It'd be really handy to get a new version cut which compiles on GHC 9.6.

thomasjm commented 1 year ago

I have no idea what happened here, the source on Hackage doesn't match the release commit.

Released https://hackage.haskell.org/package/aeson-typescript-0.6.0.0

hdgarrood commented 1 year ago

Thank you!