Merge pull request #115 from haskell-servant/jkarni/patch-safe-link

Add missing Patch case for safeLink
This commit is contained in:
Alp Mestanogullari 2015-06-05 12:44:03 +01:00
commit c162e10676
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,7 @@
0.4.2
-----
* Fix missing cases for `Patch` in `safeLink`
0.4.1
-----
* Allow whitespace after parsing JSON

View File

@ -122,6 +122,7 @@ import Servant.API.Header ( Header )
import Servant.API.Get ( Get )
import Servant.API.Post ( Post )
import Servant.API.Put ( Put )
import Servant.API.Patch ( Patch )
import Servant.API.Delete ( Delete )
import Servant.API.Sub ( type (:>) )
import Servant.API.Raw ( Raw )
@ -178,6 +179,7 @@ type family IsElem endpoint api :: Constraint where
IsElem (Get ct typ) (Get ct' typ) = IsSubList ct ct'
IsElem (Post ct typ) (Post ct' typ) = IsSubList ct ct'
IsElem (Put ct typ) (Put ct' typ) = IsSubList ct ct'
IsElem (Patch ct typ) (Patch ct' typ) = IsSubList ct ct'
IsElem (Delete ct typ) (Delete ct' typ) = IsSubList ct ct'
IsElem e e = ()
IsElem e a = IsElem' e a
@ -352,6 +354,10 @@ instance HasLink (Put y r) where
type MkLink (Put y r) = URI
toLink _ = linkURI
instance HasLink (Patch y r) where
type MkLink (Patch y r) = URI
toLink _ = linkURI
instance HasLink (Delete y r) where
type MkLink (Delete y r) = URI
toLink _ = linkURI