0

I attempted to build a project that requires RMonad package. Here is dependencies specification in my package.yaml

- dependencies:
- base >= 4.7 && < 5
- containers >= 0.5 && < 0.7
- suitable >= 0.1 && < 0.2
- rmonad >= 0.8 && < 0.9

And here is extra-deps in stack.yaml

- suitable-0.1.1
- containers-0.6.5.1
- rmonad-0.8.0.2

When building project, I got an error:

suitable > /tmp/stack-f5e19bf830e1ff79/suitable-0.1.1/src/Data/Suitable.hs:41:35: error:
suitable >     • Data constructor ‘SetConstraints’ has existential type variables, a context, or a specialised result type
suitable >         SetConstraints :: forall a. Ord a => Constraints Set a
suitable >         (Enable ExistentialQuantification or GADTs to allow this)
suitable >     • In the definition of data constructor ‘SetConstraints’
suitable >       In the data instance declaration for ‘Constraints’
suitable >    |
suitable > 41 | data instance Constraints Set a = Ord a => SetConstraints
suitable >    |                                   ^^^^^^^^^^^^^^^^^^^^^^^
suitable >  

However, I don't know how to enable language extension on the imported package. I only know how to activate it in my own source code. How do you fix this?

Xwtek
  • 1,151
  • 1
  • 9
  • 19
  • 1
    `rmonad` and `suitable` don't seem to be maintained anymore, but their functionality can be found in other packages. I always recommend [constrained-categories](https://hackage.haskell.org/package/constrained-categories) (but as the author, I'm biased). – leftaroundabout Aug 28 '21 at 13:12
  • @leftaroundabout It seems that that library is for replacing Prelude, which is overkill for use cases like this. The library is just for making sure that my Prob (about discrete probability analysis) pseudo monad can actually get a nice do notation with RebindableSyntax language extension. – Xwtek Aug 28 '21 at 14:26
  • But nevermind, I found QualifiedDo, which does the job simpler. But the problem is that it's GHC 9, while stack stable is still at GHC 8.10 – Xwtek Aug 28 '21 at 14:35
  • 1
    it's not “for replacing Prelude”, though that is a possible way you can use the library. For a module where only [`>>=`](https://hackage.haskell.org/package/constrained-categories-0.4.1.0/docs/Control-Monad-Constrained.html#v:-62--62--61-) and [`return`](https://hackage.haskell.org/package/constrained-categories-0.4.1.0/docs/Control-Monad-Constrained.html#v:return) are imported, `constrained-categories` behaves much the same as `rmonad`, only you'll need instances for slightly different classes. (And of course it can be used with `-XQualifiedDo` too.) – leftaroundabout Aug 28 '21 at 14:55
  • @Xwtek you can change the `resolver` in `stack.yaml` to `ghc-9.0.1`, in any version of stack, to use a GHC and Stackage repository based om GHC 9. – Ari Fordsham Aug 31 '21 at 11:45
  • @AriFordsham I found it already, but thanks. – Xwtek Aug 31 '21 at 11:50
  • Thanks for the report. I have created Hackage revisions for `suitable` 0.1 and 0.1.1 that tighten these packages' bounds on `base`: https://hackage.haskell.org/package/suitable-0.1/revisions/, https://hackage.haskell.org/package/suitable-0.1.1/revisions/ – sjakobi Sep 11 '21 at 11:54

1 Answers1

0

The suitable package was last uploaded in 2011, and seems to no longer be maintained, and will no longer build. The only way of using this package would be to fix it upstream.

Even if you would want to do that, the source is stored in the Darcs version control system, so it's not so user-friendly.

But certainly good luck to whoever wants to have a go!

Ari Fordsham
  • 2,437
  • 7
  • 28
  • 1
    Well, this doesn't answer my question, but it seems that there will be no better answer, and I have since found an alternative. – Xwtek Aug 31 '21 at 11:52