1{-# LANGUAGE PolyKinds #-}
2{-# LANGUAGE TypeFamilies #-}
3{-# LANGUAGE TypeOperators #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE ScopedTypeVariables #-}
6module Servant.API.Capture where
20captured :: FromText a => proxy (Capture sym a) -> Text -> Maybe a
23instance (KnownSymbol capture, FromText a, HasServer sublayout)
24 => HasServer (Capture capture a :> sublayout) where
26 type Server (Capture capture a :> sublayout) =
29 route Proxy subserver globalPathInfo request respond = case pathInfo request of
31 -> case captured captureProxy first of
32 Nothing -> respond Nothing
33 Just v -> route (Proxy :: Proxy sublayout) (subserver v) globalPathInfo request{
38 where captureProxy = Proxy :: Proxy (Capture capture a)
40instance (KnownSymbol capture, ToText a, HasClient sublayout)
41 => HasClient (Capture capture a :> sublayout) where
43 type Client (Capture capture a :> sublayout) =
46 clientWithRoute Proxy req val =
47 clientWithRoute (Proxy :: Proxy sublayout) $
50 where p = unpack (toText val)
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