Skip to content

Instantly share code, notes, and snippets.

@fizruk
Created May 15, 2017 18:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fizruk/3bc23c90a33cd85f0e55167355ca6bda to your computer and use it in GitHub Desktop.
Save fizruk/3bc23c90a33cd85f0e55167355ca6bda to your computer and use it in GitHub Desktop.
Verb with multiple methods.
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