Skip to content

Instantly share code, notes, and snippets.

@codedmart
Created May 6, 2015 17:12
Show Gist options
  • Select an option

  • Save codedmart/46fa66bd1191d03766e4 to your computer and use it in GitHub Desktop.

Select an option

Save codedmart/46fa66bd1191d03766e4 to your computer and use it in GitHub Desktop.
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE KindSignatures #-}
{-# OPTIONS_HADDOCK not-home #-}
module Servant.API.Delete (Delete) where
import Data.Typeable ( Typeable )
-- | Combinator for DELETE requests.
--
-- Example:
--
-- >>> -- DELETE /books/:isbn
-- >>> type MyApi = "books" :> Capture "isbn" Text :> Delete
data Delete a :: * -> *
deriving Typeable
-- $setup
-- >>> import Servant.API
-- >>> import Data.Aeson
-- >>> import Data.Text
-- >>> data Book
-- >>> instance ToJSON Book where { toJSON = undefined }
Running 2 test suites...
Test suite spec: RUNNING...
Test suite spec: PASS
Test suite logged to: dist/test/servant-0.2.2-spec.log
Test suite doctests: RUNNING...
### Failure in src/Servant/Utils/Links.hs:56: expression `print $ safeLink api without'
expected: bye
but got:
<interactive>:52:9:
Could not deduce (Or
(IsElem' ("bye" :> Delete ()) ("hello" :> Get '[JSON] Int))
(IsElem'
("bye" :> Delete ())
("bye" :> (QueryParam "name" String :> Delete ()))))
arising from a use of ‘safeLink’
In the second argument of ‘($)’, namely ‘safeLink api without’
In the expression: print $ safeLink api without
In an equation for ‘it’: it = print $ safeLink api without
Examples: 150 Tried: 146 Errors: 0 Failures: 1
Test suite doctests: FAIL
Test suite logged to: dist/test/servant-0.2.2-doctests.log
1 of 2 test suites (1 of 2 test cases) passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment