simplify the example a bit

This commit is contained in:
Alp Mestanogullari 2014-10-21 17:09:06 +02:00
parent dfc2676c25
commit 1a105448f0
1 changed files with 4 additions and 2 deletions

View File

@ -47,6 +47,8 @@ instance (KnownSymbol capture, Captured a, HasServer sublayout)
}
_ -> return Nothing
-- * Example
type TestApi = "hello" :> Capture "name" Text :> Get Greet
testApi :: Proxy TestApi
@ -59,8 +61,8 @@ instance ToJSON Greet
server :: Server TestApi
server =
(Proxy :: Proxy "hello")
:> (Proxy :: Proxy (Capture "name" Text))
Proxy -- :: Proxy "hello"
:> Proxy -- :: Proxy (Capture "name" Text)
:> (return . func)
where func name = Greet ("Hello, " <> name)