Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

Specifying methods #1

Open
dmjio opened this issue Apr 30, 2015 · 0 comments
Open

Specifying methods #1

dmjio opened this issue Apr 30, 2015 · 0 comments

Comments

@dmjio
Copy link

dmjio commented Apr 30, 2015

Hey, this is cool, good work. I have a question though, where do you specify the method in something like this? You'd have to do it before the pattern match I assume.

-- Define handlers for each value constructor in your URL data type.
routeAppUrl :: AppUrl -> Handler App App ()
routeAppUrl appUrl =
    case appUrl of
      (Login)     -> with auth handleLoginSubmit
      (Logout)    -> with auth handleLogout
      (Count n)   -> writeText $ ("Count = " `T.append` (T.pack $ show n))
      (Echo text) -> echo text
      (Paths ps)  -> writeText $ T.intercalate " " ps
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant