1{-# LANGUAGE TypeFamilies #-}
2{-# LANGUAGE TypeOperators #-}
3{-# LANGUAGE ScopedTypeVariables #-}
4module Servant.API.Union where
10-- | Union of two APIs, first takes precedence in case of overlap.
11data a :<|> b = a :<|> b
14instance (HasServer a, HasServer b) => HasServer (a :<|> b) where
15 type Server (a :<|> b) = Server a :<|> Server b
16 route Proxy (a :<|> b) request = do
17 m <- route (Proxy :: Proxy a) a request
19 Nothing -> route (Proxy :: Proxy b) b request
20 Just response -> return $ Just response
22instance (HasClient a, HasClient b) => HasClient (a :<|> b) where
23 type Client (a :<|> b) = Client a :<|> Client b
24 clientWithRoute Proxy req =
25 clientWithRoute (Proxy :: Proxy a) req :<|>
26 clientWithRoute (Proxy :: Proxy b) req
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list