From 208878996a3f06e866c998c1885a194c278a5d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Hamal=20Dvo=C5=99=C3=A1k?= <mordae@anilinux.org> Date: Sun, 27 Sep 2020 20:11:28 +0200 Subject: [PATCH] Clean up some comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Hamal Dvořák <mordae@anilinux.org> --- examples/Simple.hs | 6 +++--- lib/Hikaru/Dispatch.hs | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/Simple.hs b/examples/Simple.hs index fe4e076..1629433 100644 --- a/examples/Simple.hs +++ b/examples/Simple.hs @@ -110,15 +110,15 @@ where -- Disable caching for all the following endpoints. wrapAction (defaultHeader hCacheControl "no-store" >>) $ do -- Return search results and repeat the form. - route $ getSearchHtmlR <$ get <* seg "search" + route $ getSearchHtmlR <$ get </ "search" <* offerHTML -- Present a simple greeting page. - route $ getHelloR <$ get <* seg "hello" <*> arg + route $ getHelloR <$ get </ "hello" <*> arg <* offerText -- Create an echoing JSON API. - route $ postEchoR <$ post <* seg "api" <* seg "echo" + route $ postEchoR <$ post </ "api" </ "echo" <* offerJSON <* acceptJSON diff --git a/lib/Hikaru/Dispatch.hs b/lib/Hikaru/Dispatch.hs index 000cb5f..4544231 100644 --- a/lib/Hikaru/Dispatch.hs +++ b/lib/Hikaru/Dispatch.hs @@ -92,14 +92,14 @@ where -- app = dispatch runAction $ do -- 'middleware' $ logStdoutDev -- - -- 'route' $ getRootR \<$ 'get' - -- 'route' $ getHelloR \<$ 'get' <* 'seg' "hello" \<*\> 'arg' + -- 'route' $ getRootR \<$ 'Hikaru.Route.get' + -- 'route' $ getHelloR \<$ 'Hikaru.Route.get' \<\/ "hello" \<*\> 'arg' -- -- 'wrapRoute' needAuth $ do - -- 'route' $ getAdminR \<$ 'get' \<* 'seg' "admin" - -- 'route' $ postPassR \<$ 'post' \<* 'seg' "admin" \<* 'seg' "password" + -- 'route' $ getAdminR \<$ 'Hikaru.Route.get' \<\/ "admin" + -- 'route' $ postPassR \<$ 'Hikaru.Route.post' \<\/ "admin" \<\/ "password" -- - -- 'handle' 'NotFound' notFoundR + -- 'handler' 'NotFound' notFoundR -- @ -- dispatch :: forall r. (r -> Application) @@ -201,8 +201,8 @@ where -- app = 'dispatch' runAction $ do -- 'wrapRoutes' ('Hikaru.Action.defaultHeader' hCacheControl "no-cache" >>) -- - -- 'route' $ getRootR \<$ 'get' - -- 'route' $ getHelloR \<$ 'get' <* 'seg' "hello" \<*\> 'arg' + -- 'route' $ getRootR \<$ 'Hikaru.Route.get' + -- 'route' $ getHelloR \<$ 'Hikaru.Route.get' \<\/ "hello" \<*\> 'arg' -- @ -- wrapActions :: (r -> r) -> Dispatch r l () -- GitLab