@@ -29,7 +29,7 @@ import Control.Monad.Trans.Except
29import Data.Aeson
29import Data.Aeson
30import Data.Char
30import Data.Char
31import Data.Foldable (forM_)
31import Data.Foldable (forM_)
32−import Data.Monoid
32+import Data.Monoid hiding (getLast)
33import Data.Proxy
33import Data.Proxy
34import qualified Data.Text as T
34import qualified Data.Text as T
35import GHC.Generics
35import GHC.Generics
@@ -166,9 +166,9 @@ sucessSpec = beforeAll (startWaiApp server) $ afterAll endWaiApp $ do
166 let getDeleteEmpty = getNth (Proxy :: Proxy 1) $ client api baseUrl manager
166 let getDeleteEmpty = getNth (Proxy :: Proxy 1) $ client api baseUrl manager
167 (left show <$> runExceptT getDeleteEmpty) `shouldReturn` Right ()
167 (left show <$> runExceptT getDeleteEmpty) `shouldReturn` Right ()
169− {-it "allows content type" $ \(_, baseUrl) -> do-}
169+ it "allows content type" $ \(_, baseUrl) -> do
170− {-let getDeleteContentType = getNth (Proxy :: Proxy 14) $ client api baseUrl manager-}
170+ let getDeleteContentType = getLast $ client api baseUrl manager
171− {-(left show <$> runExceptT getDeleteContentType) `shouldReturn` Right ()-}
171+ (left show <$> runExceptT getDeleteContentType) `shouldReturn` Right ()
173 it "Servant.API.Capture" $ \(_, baseUrl) -> do
173 it "Servant.API.Capture" $ \(_, baseUrl) -> do
174 let getCapture = getNth (Proxy :: Proxy 2) $ client api baseUrl manager
174 let getCapture = getNth (Proxy :: Proxy 2) $ client api baseUrl manager
@@ -350,8 +350,14 @@ class GetNth (n :: Nat) a b | n a -> b where
350instance GetNth 0 (x :<|> y) x where
350instance GetNth 0 (x :<|> y) x where
351 getNth _ (x :<|> _) = x
351 getNth _ (x :<|> _) = x
353−{-instance GetNth 0 x x where-}
356instance (GetNth (n - 1) x y) => GetNth n (a :<|> x) y where
353instance (GetNth (n - 1) x y) => GetNth n (a :<|> x) y where
357 getNth _ (_ :<|> x) = getNth (Proxy :: Proxy (n - 1)) x
354 getNth _ (_ :<|> x) = getNth (Proxy :: Proxy (n - 1)) x
356+class GetLast a b | a -> b where
359+instance (GetLast b c) => GetLast (a :<|> b) c where
360+ getLast (_ :<|> b) = getLast b
362+instance GetLast a a where