Created
March 3, 2015 17:00
-
-
Save jkarni/251a44ddae64f6556e44 to your computer and use it in GitHub Desktop.
Get method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- completely untested | |
type MyEndpoint = "something" :> Get Int | |
class GetMethod a where | |
getMethod :: Proxy a -> String | |
instance GetMethod (Get x) where | |
getMethod _ = "GET" | |
-- similarly for POST, DELETE, etc. | |
instance GetMethod b => GetMethod (a :> b) where | |
getMethod _ = getMethod (Proxy b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment