1{-# LANGUAGE PolyKinds #-}
2{-# LANGUAGE TypeFamilies #-}
3{-# LANGUAGE TypeOperators #-}
4{-# LANGUAGE ScopedTypeVariables #-}
5module Servant.API.Sub where
8import Data.String.Conversions
14-- | The contained API (second argument) can be found under @("/" ++ path)@
15-- (path being the first argument).
16data (path :: k) :> a = Proxy path :> a
19instance (KnownSymbol path, HasServer sublayout) => HasServer (path :> sublayout) where
20 type Server (path :> sublayout) = Server sublayout
21 route Proxy subserver request = case pathInfo request of
23 | first == cs (symbolVal proxyPath)
24 -> route (Proxy :: Proxy sublayout) subserver request{
29 where proxyPath = Proxy :: Proxy path
31instance (KnownSymbol path, HasClient sublayout) => HasClient (path :> sublayout) where
32 type Client (path :> sublayout) = Client sublayout
34 clientWithRoute Proxy req =
35 clientWithRoute (Proxy :: Proxy sublayout) $
38 where p = symbolVal (Proxy :: Proxy path)
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