git.iko.soy/typeable/servant
on master help sign in
Add ReflectMethod instances for OPTIONS, TRACE, and CONNECT
ba57d20Andrew Gibiansky
servant/src/Servant/API/Verbs.hs+12−1
@@ -14,7 +14,9 @@ import GHC.Generics (Generic)
14import GHC.TypeLits (Nat)
14import GHC.TypeLits (Nat)
15import Network.HTTP.Types.Method (Method, StdMethod (..),
15import Network.HTTP.Types.Method (Method, StdMethod (..),
16 methodDelete, methodGet, methodHead,
16 methodDelete, methodGet, methodHead,
17− methodPatch, methodPost, methodPut)
17+ methodPatch, methodPost, methodPut,
18+ methodTrace, methodConnect,
19+ methodOptions)
18
20
19-- | @Verb@ is a general type for representing HTTP verbs (a.k.a. methods). For
21-- | @Verb@ is a general type for representing HTTP verbs (a.k.a. methods). For
20-- convenience, type synonyms for each verb with a 200 response code are
22-- convenience, type synonyms for each verb with a 200 response code are
@@ -167,3 +169,12 @@ instance ReflectMethod 'PATCH where
167
169
168instance ReflectMethod 'HEAD where
170instance ReflectMethod 'HEAD where
169 reflectMethod _ = methodHead
171 reflectMethod _ = methodHead
172+
173+instance ReflectMethod 'OPTIONS where
174+ reflectMethod _ = methodOptions
175+
176+instance ReflectMethod 'TRACE where
177+ reflectMethod _ = methodTrace
178+
179+instance ReflectMethod 'CONNECT where
180+ reflectMethod _ = methodConnect