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

Overlapping instances found #9

Closed
rubenmoor opened this issue Aug 13, 2015 · 24 comments
Closed

Overlapping instances found #9

rubenmoor opened this issue Aug 13, 2015 · 24 comments

Comments

@rubenmoor
Copy link

Is the problem just this, or are my dependencies messed up?

Compiling Data.Enum
Error found:
Error in module Data.Enum:
Error in value declaration enumChar:
Error at /home/ruben/code/holger/hermit/bower_components/purescript-enums/src/Data/Enum.purs line 113, column 1 - line 121, column 1:
Overlapping instances found for Prelude.Bounded Prim.Char:
Data.Char.boundedChar
Prelude.boundedChar

@garyb
Copy link
Member

garyb commented Aug 13, 2015

It's not your fault, but yeah the dependencies are messed up - the Data.Char.boundedChar is an orphan instance, so we removed it from there and added it to Prelude (also it was incorrect). The prelude version was bumped as a patch release, but the update to strings was a breaking change release, but we've also updated everything in core that depended on strings so hopefully you should be able to update your dependency versions and everything should work out...

@paf31 looks like you were right though, maybe we should have bumped Prelude after all 😢 I'm not sure why the orphan instance error is appearing here when it seemed not to when I tested compiling new strings with the old prelude.

@paf31
Copy link
Contributor

paf31 commented Aug 13, 2015

Does this happen after enums is updated?

@garyb
Copy link
Member

garyb commented Aug 13, 2015

It shouldn't

@paf31
Copy link
Contributor

paf31 commented Aug 13, 2015

But does it? 😄

@garyb
Copy link
Member

garyb commented Aug 13, 2015

Not for me 😉 - I ran the post-travis-test-everything locally after updating the libraries.

@paf31
Copy link
Contributor

paf31 commented Aug 13, 2015

Maybe a cache issue then?

@rubenmoor
Copy link
Author

I ran

$ bower cache clean
$ bower update

Still got the issue upon compiling.

@garyb
Copy link
Member

garyb commented Aug 14, 2015

bower update won't update to the new version automatically as the new version is incompatible with the old - you'll need to update your purescript-enums dependency to ^0.7.0 (or whatever it is that is pulling purescript-enums in).

@rubenmoor
Copy link
Author

oh sure. Unfortunately, i end up with purescript-enums 0.5.0 automatically. My dep tree looks like this

purescript-node-fs 0.7.1 (or master)
    requires purescript-datetime 0.6.0
        requires purescript-enums 0.5.0

Adding

"purescript-enums": "^0.7.0"

to dependencies results in conflicts for bower update and quite regardless of my choice I run into the overlapping instances error. And adding the 0.7.0 to resolutions does nothing (not even a conflict during bower update)

@garyb
Copy link
Member

garyb commented Aug 14, 2015

Ahh ok! I'll update purescript-node-fs. I forgot about the projects in purescript-node.

@garyb
Copy link
Member

garyb commented Aug 14, 2015

If you bump your purescript-node-fs to v0.8.0 it should work out now, hopefully.

@rubenmoor
Copy link
Author

Now I run into issues with my other dependencies:

Unable to find a suitable version for purescript-foreign, please choose one:
1) purescript-foreign#^0.5.0 which resolved to 0.5.1 and is required by purescript-affjax#0.4.0, purescript-halogen#0ed8df5900
2) purescript-foreign#^0.7.0 which resolved to 0.7.0 and is required by purescript-node-fs#0.8.0

I'll keep trying. Is there a standard way to resolve this?

@rubenmoor
Copy link
Author

If I'm not mistaken, this is rather hopeless, or at least I lack overview on why and how packages depend on the older versions of purescript-strings and I am not able to resolve my issue by trying out different combinations.

Unable to find a suitable version for purescript-strings, please choose one:
1) purescript-strings#^0.5.0 which resolved to 0.5.5 and is required by purescript-enums#0.5.0, purescript-simple-dom#0.1.0, purescript-string-parsers#03d8277615
2) purescript-strings#~0.5.3 which resolved to 0.5.5 and is required by purescript-argonaut-codecs#0.1.0, purescript-foreign#0.5.1
3) purescript-strings#^0.5.2 which resolved to 0.5.5 and is required by purescript-css#150ae110d3
4) purescript-strings#^0.7.0 which resolved to 0.7.0 and is required by purescript-enums#0.7.0, purescript-foreign#0.7.0

@rubenmoor
Copy link
Author

Any idea for a workaround?

@garyb
Copy link
Member

garyb commented Aug 14, 2015

Ok, for the time being as an alternative, what happens if you stick to your original set of dependencies but add "purescript-prelude": "0.1.1"? This should prevent bower from pulling in v0.1.2 of the prelude which has the new instance in it.

In the long run all the stuff you're depending on will need updating anyway, as the old version of purescript-strings will not work with the most recent compiler release (v0.7.3, released yesterday). Some of them I'm responsible for anyway - namely affjax and halogen, so they will be updated in the near future.

@rubenmoor
Copy link
Author

That works for me. Thanks!

@garyb
Copy link
Member

garyb commented Aug 14, 2015

Great, sorry you had such trouble with it!

@garyb garyb closed this as completed Aug 14, 2015
@Thimoteus
Copy link

For some reason that fix doesn't work for me. I have purescript-prelude#0.1.1 in my bower.json, grep -r "Enum Char" bower_components/* and grep -r "Bounded Char" bower_components/* only give me a single instance each. I've removed bower_componenets/ and done bower cache clean many times, can't seem to get around it.

@garyb
Copy link
Member

garyb commented Aug 15, 2015

@Thimoteus purescript-strings pre-v0.7.0 combined with purescript-prelude v0.1.2 is the "real" culprit here, so if you have the older strings as a dependency that's where the issue will be coming from.

@Thimoteus
Copy link

I added purescript-strings#0.7.0 as a dependency but the problem persists. I'm out of ideas, shouldn't it not happen if I have purescript-strings before 0.7.0 and purescript-prelude 0.1.1?

@garyb
Copy link
Member

garyb commented Aug 15, 2015

Oh, sorry, yep, prelude v0.1.1 should be fine with any version of strings.

What do you get from bower list after installing now?

@Thimoteus
Copy link

@garyb
Copy link
Member

garyb commented Aug 15, 2015

:(

Did you try removing the output folder as well before compiling?

@Thimoteus
Copy link

Ahh, that worked. I always forget about the output folder ...

thanks!

JordanMartinez added a commit that referenced this issue Dec 25, 2020
* first commit

* Fix instances for record fields

* Break modules up

* Deriving Show (#5)

* Initial work on deriving Show

* Add test for Show

* Remove import

* Travis etc.

* Data.Generic.Rep.Bounded (#6)

* Data.Generic.Rep.Bounded

Generic implementations of Prelude.Bounded class's top and bottom.

* GenericBounded - don't support product types

* GenericBounded - only support NoArguments

* Update for PureScript 0.11

* Add Generic instance for Maybe (#9)

* Add missing Bounded instances for Argument

* Add GenericEnum and GenericBoundedEnum

* Add enum tests, convert existing "tests" into assertions

* Product instances in Bounded and Enum

* Added GenericShowFields instances for NoConstructors and NoArguments (#20)

* Added Eq and Show instances to NoArguments and NoConstructors

* Added GenericShowFields

* Removed Show, Eq

* Cleanup

* Removed NoConstructors Show instance

* Remove Rec and Field & update package & bower symbols

* Bump deps for compiler/0.12

* Remove symbols and fix operator fixity issue

* Update dependencies, license

* Added HeytingAlgebra, Semiring, Ring

* Fix type annotation precedence in tests

* Replace monomorphic proxies by Type.Proxy.Proxy (#44)

* Move Enum file to Data.Enum.Generic

* Update module name to match file name for Enum

* Update module path for Bounded Generic

* Move test file to Data.Enum folder and rename to Generic.purs

* Remove code unrelated to Enum in test file

* Update Generic X module names to Data.X.Generic

* Rename `main` function in test file to testGenericEnum

* Update module name in test file to match file name

* Remove all files in repo that are unrelated to Enum Generic

* Include Enum's Generic tests in repo's tests

* Remove unused logShow

Co-authored-by: Phil Freeman <[email protected]>
Co-authored-by: Matthew Leon <[email protected]>
Co-authored-by: Gary Burgess <[email protected]>
Co-authored-by: Liam Goodacre <[email protected]>
Co-authored-by: Jorge Acereda <[email protected]>
Co-authored-by: Kristoffer Josefsson <[email protected]>
Co-authored-by: Denis Stoyanov <[email protected]>
Co-authored-by: Harry Garrood <[email protected]>
Co-authored-by: Cyril <[email protected]>
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

4 participants