on master help sign in
Canonicalize the API type to make sure that the following 'law' holds: Server (a :> (b :<|> c)) ~ Server (a :> b) :<|> Server (a :> c)
837099dAlp Mestanogullari
src/Servant/Server/Internal.hs+1−2
@@ -165,7 +165,6 @@ class HasServer layout where
165
165
166type Server' layout = ServerT layout (EitherT (Int, String) IO)
166type Server' layout = ServerT layout (EitherT (Int, String) IO)
167
167
168−
169-- * Instances
168-- * Instances
170
169
171-- | A server for @a ':<|>' b@ first tries to match the request against the route
170-- | A server for @a ':<|>' b@ first tries to match the request against the route
@@ -184,7 +183,7 @@ instance (HasServer a, HasServer b) => HasServer (a :<|> b) where
184 type ServerT (a :<|> b) m = ServerT a m :<|> ServerT b m
183 type ServerT (a :<|> b) m = ServerT a m :<|> ServerT b m
185
184
186 route Proxy (a :<|> b) request respond =
185 route Proxy (a :<|> b) request respond =
187− route pa a request $ \ mResponse ->
186+ route pa a request $ \mResponse ->
188 if isMismatch mResponse
187 if isMismatch mResponse
189 then route pb b request $ \mResponse' -> respond (mResponse <> mResponse')
188 then route pb b request $ \mResponse' -> respond (mResponse <> mResponse')
190 else respond mResponse
189 else respond mResponse