git.iko.soy/typeable/servant
on master help sign in
Add missing Patch case for safeLink
commit8b0ade729e45e8f450d1fdd6237e025d389decab authorJulian K. Arni <jkarni@gmail.com> dateFri 5 Jun 2015, 12:18 (11 years ago) parent664691e
2 files changed+10
servant/CHANGELOG.md+4 servant/src/Servant/Utils/Links.hs+6
servant/CHANGELOG.md+4
@@ -1,3 +1,7 @@
1+0.4.2
2+-----
3+* Fix missing cases for `Patch` in `safeLink`
4+
150.4.1
26-----
37* Allow whitespace after parsing JSON
servant/src/Servant/Utils/Links.hs+6
@@ -122,6 +122,7 @@ import Servant.API.Header ( Header )
122122import Servant.API.Get ( Get )
123123import Servant.API.Post ( Post )
124124import Servant.API.Put ( Put )
125+import Servant.API.Patch ( Patch )
125126import Servant.API.Delete ( Delete )
126127import Servant.API.Sub ( type (:>) )
127128import Servant.API.Raw ( Raw )
@@ -178,6 +179,7 @@ type family IsElem endpoint api :: Constraint where
178179 IsElem (Get ct typ) (Get ct' typ) = IsSubList ct ct'
179180 IsElem (Post ct typ) (Post ct' typ) = IsSubList ct ct'
180181 IsElem (Put ct typ) (Put ct' typ) = IsSubList ct ct'
182+ IsElem (Patch ct typ) (Patch ct' typ) = IsSubList ct ct'
181183 IsElem (Delete ct typ) (Delete ct' typ) = IsSubList ct ct'
182184 IsElem e e = ()
183185 IsElem e a = IsElem' e a
@@ -352,6 +354,10 @@ instance HasLink (Put y r) where
352354 type MkLink (Put y r) = URI
353355 toLink _ = linkURI
354356
357+instance HasLink (Patch y r) where
358+ type MkLink (Patch y r) = URI
359+ toLink _ = linkURI
360+
355361instance HasLink (Delete y r) where
356362 type MkLink (Delete y r) = URI
357363 toLink _ = linkURI