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
error involving uverb #1381
Comments
Now I also get this:
Even if i turn on incoherent instances. |
My feeling is that our type-error type-family is hiding the true error in your first example. Could you try commenting out our friendly error messages and see if the error is more helpful? |
I think the type equality operator (
|
That makes sense. |
Ah, yeah, not the best example. But it can be adapted to be closer to the original issue (having the same type variable on both sides), still showing the same problem:
So |
Yeh checking equality on polymorphic types does not work in Haskell. Hence you can only call
|
Yeh https://hackage.haskell.org/package/base-4.14.0.0/docs/src/Data.Type.Equality.html#%3D%3D |
Yes, propagating the constraint up is a decent workaround. |
Cool, thanks for solving this! We should add this to the cookbook before closing the issue. I'll assign it to myself! |
The `Elem` call was not possible to resolve with polymophic type. For example, the following `forall a. Elem (Maybe a) '[Maybe a, Int]` cannot be resolved. I don't really understand the reasons why, looks like the former implementation with `If (a == b)` does not work with polymophic types. The new implementation uses pattern matching in closed type families. Close haskell-servant#1590 and haskell-servant#1381.
If you copy the following code into
Servant.API.UVerb.Union
:you get:
Without the phantom tag, it compiles fine. I would have expected it to compile both ways.
The text was updated successfully, but these errors were encountered: