servant
servant copied to clipboard
HasSwagger instance of UVerb depends on overlappable HasSwagger instance of Verb
This is HasSwagger UVerb ... defined here
instance
{-# OVERLAPPABLE #-}
( ToSchema a,
HasStatus a,
AllAccept cs,
SwaggerMethod method,
HasSwagger (UVerb method cs as)
) =>
HasSwagger (UVerb method cs (a ': as))
where
toSwagger _ =
toSwagger (Proxy :: Proxy (Verb method (StatusOf a) cs a))
`combineSwagger` toSwagger (Proxy :: Proxy (UVerb method cs as))
it depends on overlappable instance HasSwagger Verb .. by calling toSwagger (Proxy :: Proxy (Verb method (StatusOf a) cs a)). When this instance is actually overriden in a dependant module, the HasSwagger instance for UVerb doesn't pick that up as it is already compiled and linked with the now overlapped instance. This makes it confusing to write custom instances for a special type.
Moved from: https://github.com/haskell-servant/servant-swagger/issues/133
Roughly in the same spirit of #1431, UVerb's overlapping instances are causing a bunch of issues.