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

Support for GHC 9.6 #45

Open
Vekhir opened this issue Dec 17, 2023 · 0 comments
Open

Support for GHC 9.6 #45

Vekhir opened this issue Dec 17, 2023 · 0 comments

Comments

@Vekhir
Copy link

Vekhir commented Dec 17, 2023

Hi @sebastiaanvisser,
The module Control.Monad.Trans.Error was deprecated a long time ago and finally removed in transformers 0.6 which is shipped with GHC 9.6.
This leads to this error:

[1 of 1] Compiling Main             ( test/TestSuite.hs, dist/build/suite/suite-tmp/Main.dyn_o )

test/TestSuite.hs:26:1: error:
    Could not find module ‘Control.Monad.Trans.Error’
    Perhaps you meant
      Control.Monad.Trans.Writer (from transformers-0.6.1.0)
      Control.Monad.Trans.RWS (from transformers-0.6.1.0)
      Control.Monad.Trans.Cont (from transformers-0.6.1.0)
    Use -v (or `:set -v` in ghci) to see a list of the files searched for.
   |
26 | import Control.Monad.Trans.Error (Error (noMsg))
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Removing the offending line, another error occurs:

[1 of 1] Compiling Main             ( test/TestSuite.hs, dist/build/suite/suite-tmp/Main.dyn_o )

test/TestSuite.hs:187:8: error: [GHC-39999]
    • No instance for ‘MonadPlus (Either String)’
        arising from a use of ‘mA’
    • In the expression: mA
      In an equation for ‘mA_f’: mA_f = mA
    |
187 | mA_f = mA
    |        ^^

In the relevant file, test/TestSuite.hs, there is the following remark:

-- These instance are needed for the `Failing.Lens String` instance,
-- since that needs a `MonadZero` constraint on `Kleisli (Either String)`,
-- which in turn needs a `MonadPlus (Either String)` constraint.
-- These instances used to exist in transformers but were removed in
-- 0.5.0.0 accidentally, and added in 0.5.2.0. We can probably remove
-- this ifdef after GHC 8 rc3 is released, which will include
-- transformers-0.5.2.0.

#if MIN_VERSION_transformers(0,5,0) && !MIN_VERSION_transformers(0,5,2) && MIN_VERSION_base(4,9,0)
instance (Error e) => Alternative (Either e) where
    empty        = Left noMsg
    Left _ <|> n = n
    m      <|> _ = m

instance Error e => MonadPlus (Either e) where
    mzero            = Left noMsg
    Left _ `mplus` n = n
    m      `mplus` _ = m
#endif

Not quite sure what to make of it. Do you have an idea how to fix this issue?

-- Vekhir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant