-
-
Notifications
You must be signed in to change notification settings - Fork 419
Closed
Labels
uverbBugs and questions related to UVerbBugs and questions related to UVerb
Description
If you copy the following code into Servant.API.UVerb.Union
:
data User tag = User
type XS tag = Union '[User tag, ()]
f :: forall tag m. Applicative m => User tag -> m (XS tag)
f usr = either respond respond $ (undefined :: Either () (User tag))
respond ::
forall (x :: *) (xs :: [*]) (f :: * -> *).
(Applicative f, IsMember x xs) =>
x ->
f (Union xs)
respond = pure . inject . I
you get:
Servant/API/UVerb/Union.hs:159:24: warning: [-Wdeferred-type-errors]
• Expected one of:
'[User tag, ()]
But got:
User tag
• In the second argument of ‘either’, namely ‘respond’
In the expression: either respond respond
In the expression:
either respond respond $ (undefined :: Either () (User tag))
|
159 | f usr = either respond respond $ (undefined :: Either () (User tag))
| ^^^^^^^
Without the phantom tag, it compiles fine. I would have expected it to compile both ways.
Metadata
Metadata
Assignees
Labels
uverbBugs and questions related to UVerbBugs and questions related to UVerb