Closed mastarija closed 9 months ago
If someone more experienced with servant could confirm that this is indeed the case and this instance should exist (and it's not just working by accident) then I'd be happy to do a pull request for this issue.
is this not solved by this - https://github.com/haskell-servant/servant/pull/1531 ?
@silky I'm not sure. #1531 was merged in February, but I still experienced this problem in August. :/
i see
well, i'm no expert, but your solution certainly seems reasonable to me :)
A colleague and I hit this problem with one of our API types and spent a good amount of time looking at the proposed new instance, as well as reading the GHC description of overlapping instance pragmas. I'm pretty sure this is correct, and #1653 is probably not what's wanted.
@endgame well, I guess that's enough encouragement for me to open a PR then :). I'll try to do it over the weekend.
Fantastic, thank you both
@endgame I think so
So, I've got this error
If we look carefully, it's saying that for this type:
It cannot decide if it should use
AddSetCookies ('S n) (m old) (m new)
orAddSetCookies ('S n) (a :<|> b) (a' :<|> b')
.This is because the first branch is the same e.g.
AddSetCookies ('S n) (a:<|>b) (a :<|>b)
and thereforea :<|>
can be interpreted asm
inAddSetCookies ('S n) (m old) (m new)
.It's seems perfectly reasonable to me that the
a
branch can stay the same after theAddSetCookie
transformation. I've written this orphan instance that fixed my issue.