monadlib icon indicating copy to clipboard operation
monadlib copied to clipboard

Build failure with GHC 9.2.1

Open sjakobi opened this issue 4 years ago • 1 comments

src/MonadLib.hs:200:10: error:
    • Non type-variable argument in the constraint: RunM m (a, i) r
      (Use FlexibleContexts to permit this)
    • In the instance declaration for ‘RunM (WriterT i m) a r’
    |
200 | instance (Monoid i, RunM m (a,i) r) => RunM (WriterT i m) a r where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/MonadLib.hs:203:10: error:
    • Non type-variable argument in the constraint: RunM m (a, i) r
      (Use FlexibleContexts to permit this)
    • In the instance declaration for ‘RunM (StateT i m) a (i -> r)’
    |
203 | instance RunM m (a,i) r => RunM (StateT i m) a (i -> r) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/MonadLib.hs:206:10: error:
    • Non type-variable argument
        in the constraint: RunM m (Either i a) r
      (Use FlexibleContexts to permit this)
    • In the instance declaration for ‘RunM (ExceptionT i m) a r’
    |
206 | instance RunM m (Either i a) r => RunM (ExceptionT i m) a r where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/MonadLib.hs:212:10: error:
    • Non type-variable argument
        in the constraint: RunM m (Maybe (a, ChoiceT m a)) r
      (Use FlexibleContexts to permit this)
    • In the instance declaration for ‘RunM (ChoiceT m) a r’
    |
212 | instance RunM m (Maybe (a,ChoiceT m a)) r => RunM (ChoiceT m) a r where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build monadLib-3.10.

This might be related to this change?! https://gitlab.haskell.org/ghc/ghc/-/wikis/migration/9.2#undecidableinstances-no-longer-implies-flexiblecontexts-in-instance-declarations

sjakobi avatar Nov 13 '21 05:11 sjakobi

As a Hackage trustee, I have created a Hackage revision that should prevent users from running into this error: https://hackage.haskell.org/package/monadLib-3.10/revisions/

sjakobi avatar Nov 13 '21 05:11 sjakobi