Fix isElem for Header.

The intention was obviously to ignore them, but we weren't doing so
    correctly.
This commit is contained in:
Julian K. Arni 2015-07-21 15:22:56 +02:00
parent 3209f98985
commit 29e3c1a45a
3 changed files with 3 additions and 2 deletions

View file

@ -2,6 +2,7 @@ HEAD
----
* Add `HttpVersion`, `IsSecure`, `RemoteHost` and `Vault` combinators
* Fix safeLink, so Header is not in fact required.
0.4.2
-----

View file

@ -166,7 +166,7 @@ type family IsElem' a s :: Constraint
type family IsElem endpoint api :: Constraint where
IsElem e (sa :<|> sb) = Or (IsElem e sa) (IsElem e sb)
IsElem (e :> sa) (e :> sb) = IsElem sa sb
IsElem sa (Header x :> sb) = IsElem sa sb
IsElem sa (Header sym x :> sb) = IsElem sa sb
IsElem sa (ReqBody y x :> sb) = IsElem sa sb
IsElem (Capture z y :> sa) (Capture x y :> sb)
= IsElem sa sb

View file

@ -25,7 +25,7 @@ type TestApi =
:<|> "get" :> Get '[JSON] ()
:<|> "put" :> Put '[JSON] ()
:<|> "post" :> ReqBody '[JSON] 'True :> Post '[JSON] ()
:<|> "delete" :> Header "ponies" :> Delete '[JSON] ()
:<|> "delete" :> Header "ponies" String :> Delete '[JSON] ()
:<|> "raw" :> Raw
type TestLink = "hello" :> "hi" :> Get '[JSON] Bool