Created
May 15, 2017 18:18
-
-
Save fizruk/3bc23c90a33cd85f0e55167355ca6bda to your computer and use it in GitHub Desktop.
Verb with multiple methods.
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
class AllReflectMethod methods where | |
reflectMethods :: Proxy methods -> [Method] | |
instance AllReflectMethod '[] where | |
reflectMethods _ = [] | |
instance (ReflectMethod m, AllReflectMethod ms) => AllReflectMethod (m:ms) where | |
reflectMethods _ = reflectMethod (Proxy @m) : reflectMethods (Proxy @ms) | |
instance OVERLAPPING_ | |
( AllCTRender ctypes a, AllReflectMethod methods, KnownNat status | |
, GetHeaders (Headers h a) | |
) => HasServer (Verb (methods :: [StdMethod]) status ctypes (Headers h a)) context where | |
type ServerT (Verb '[] ...) m = m () ??? | |
type ServerT (Verb (x ': xs) ...) m = ... :<|> ... | |
route :: Proxy api -> Context context -> Delayed env (Server api) -> Router env | |
route ??? | |
type PostGet = Verb '[POST, GET] 200 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment