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

Using Data.Convertible.Base.convert directly does not compile #14

Open
MHova opened this issue Oct 5, 2017 · 2 comments
Open

Using Data.Convertible.Base.convert directly does not compile #14

MHova opened this issue Oct 5, 2017 · 2 comments

Comments

@MHova
Copy link

MHova commented Oct 5, 2017

I was using the convert from import Data.Convertible.Base (convert). The compiler kept complaining about the lack of suitable Convertible instances for types that definitely did have Convertible instances (such as instance Convertible Char Int).

I finally figured out that I had to instead use import Data.Convertible (convert). But this is baffling to me because Data.Convertible just re-exports the stuff from Data.Convertible.Base. Can anyone explain why this happens?

@hesselink
Copy link
Member

This is because Data.Convertible.Base does not contain the instances. These are Data.Convertible.Instances (and submodules), which is imported by Data.Convertible. Since instances can't be explicitly imported, you get the automatically when you import Data.Convertible, but not when you import Data.Convertible.Base.

@MHova
Copy link
Author

MHova commented Oct 6, 2017

Ah I see. Would it make sense to put something in the README about this? Or perhaps just hide the Data.Convertible.Base module entirely and only allow access via the Data.Convertible re-export?

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

2 participants