Commit Graph

51 Commits

Author SHA1 Message Date
andremarianiello 751350ba9e
WithResource combinator for Servant-managed resources (#1630) 2022-12-29 19:00:47 +01:00
Gaël Deest 9a99ef9a0b Re-export Servant.API.Generic in Servant.API 2022-03-21 13:31:33 +01:00
Gaël Deest fca59556dd Code reorganization
Move `HasServer (NamedRoutes routes)` instance

The instance has been moved to `Servant.Server.Internal`, as the
instances for other combinators. It is necessary so that the instance
can be re-exported from `Servant.Server` without circular imports.

Otherwise, users have to import `Servant.Server.Generic` manually ;
forgetting to do so will produce confusing error messages about the
missing instance.

Move `HasClient (NamedRoutes routes)` instance

Moved so that the instance is made available when importing
`Servant.Client`, avoiding possibly confusing errors when
`Servant.Client.Generic` isn't imported.
2021-11-18 10:09:58 +01:00
Andrey Prokopenko da0c83d318
Add URI fragment as a separate combinator (#1324) 2020-11-18 21:57:20 +03:00
fisx c1105899f4
union verbs (#1314) 2020-10-31 20:45:46 +01:00
Catherine Galkina b440af900b Implemented NoContentVerb and server instances for it 2019-09-29 14:18:13 +03:00
Oleg Grenrus 3001ed7990 Add mods to StreamBody 2018-11-09 21:49:53 +02:00
Oleg Grenrus db80f41dee
Merge pull request #1064 from DanBurton/lookup-response-header
Add lookupResponseHeader
2018-11-08 18:36:09 +02:00
Oleg Grenrus 45c1cbdfd5 Refactor Stream stuff
- Introduce SourceT, which is simple variant of "correct `ListT`".
  There are another variants possible (like in `streaming`),
  but I'm not sure there's much real difference.

- Introduce `Codensity`. There's a flag if people don't want to depend
  on `kan-extensions`.

- `StreamGenerator` and `ResultStream` are both `SourceT`.
  `Stream` combinator in `servant-client` uses `Codensity` for CPS.

- Add servant-machines, servant-conduit, servant-pipes
- Add streaming cookbook: just code, no explanations.
- Add a script to run streaming 'benchmarks'
2018-11-05 15:48:47 +02:00
Dan Burton e604b930dc
Add lookupResponseHeader 2018-10-28 01:36:40 -04:00
messis 9df6b1f2a5 Add PutCreated verb 2018-08-13 15:26:34 +02:00
messis 13b521eb90 Add PutCreated verb 2018-08-13 15:15:45 +02:00
Oleg Grenrus f9bcc15d0b Apply stylish-haskell on all modules 2018-06-29 23:36:39 +03:00
Oleg Grenrus 2c02287b6b Move Servant.Utils.Links -> Servant.Links. Fixes #997. 2018-06-25 14:27:17 +03:00
Oleg Grenrus dcc67f3089 Add FromResultStream/ToStreamGenerator [a] instances.
- Add Streaming endpoint to the comprehensive API.
- Rename BuildFromStream to FromResultStram
   - I'm tempted to rename everything in the Servant.API.Stream
     (add some prefixes, `header` is too good name to steal)

The TODO in `servant-docs` is left intentionally.
2018-06-24 21:52:09 +03:00
Jan van Brügge b80a3e6279 Add `NoFraming` strategy 2018-05-24 05:08:48 +02:00
Oleg Grenrus 8058891299 Reformat servant 2018-03-11 17:58:31 +02:00
Oleg Grenrus 3e1748c965 Add description modifier helpers and parametrise Capture 2018-02-15 12:28:42 +02:00
Oleg Grenrus bc3f61d615 Add Servant.API.Modifiers to servant
Changes Header, ReqBody and QueryParam to take a modifier list.

Resolves https://github.com/haskell-servant/servant/issues/856

ResponseHeader story turns to be somewhat ugly, but it can be made
elegant when https://github.com/haskell-servant/servant/issues/841 is
implemnted, then we can omit HList aka Header Heterogenous List
implementation.

- servant-server changes:

  Writing server side intepretations is quite simple using
  `unfoldRequestArgument`, which makes Header and QueryParam look quite
  the same.

  `ReqBody` cannot be easily made optional with current design (what that
  would mean: No Content-Type Header?), so that dimensions isn't used
  there.

- Add HasLink for all the rest ComprehensiveAPI combinators
- Add 'tricky' Header', QueryParam' endpoints to ComprehensiveAPI
- servant-docs: Quick'n'dirty implementation. Don't use modifiers information (yet).
2018-01-25 09:10:11 +02:00
Gershom 38e87397e7 add tests, fix to make tests work 2017-11-04 00:10:29 -04:00
Gershom 0c77a2b4b0 make client endpoint give polymorphic result 2017-10-24 17:26:18 -07:00
Gershom e75a3cc37b streaming client actually streams 2017-10-24 17:12:21 -07:00
Gershom 9a2ac6f4dd HasClient instance for Stream 2017-10-20 15:09:11 -04:00
Gershom 9132a5bb84 fix indentation 2017-10-19 17:43:01 -04:00
Gershom d4168aa3ae first round of changes 2017-10-19 17:41:49 -04:00
Gershom c5e04514f9 initial checkin 2017-10-18 18:43:43 -04:00
Catherine Galkina 2e59a82d01 Add Description and Summary combinators 2017-06-08 17:35:24 +03:00
David Turner 5a65563d9a Re-export EmptyAPI(..) from Servant.API 2017-05-16 10:05:58 +00:00
Oleg Grenrus 2b12436d3b Fix tests (URI -> Link) 2017-01-16 10:47:22 +02:00
Julian K. Arni ed82056052 Add noHeader function.
Which allows not adding a header where a signature declares one, making
    response headers optional.
2016-10-21 14:36:14 +02:00
Julian K. Arni 0870b3b2f5 Remove FromFormUrlEncoded and ToFormUrlEncoded.
In favor of FromForm and ToForm from the new version of http-api-data.
2016-09-12 18:34:18 -03:00
Jonathan Lange a616a8d689 Add CaptureAll to the API definitions 2016-07-11 14:46:31 +01:00
aaron levin b3af5a8d95 Move general authentication to Experimental module
Removes the UndecidableInstances extension in the module containing the
HasServer instances.
2016-03-09 22:30:34 +01:00
aaron levin 038abb433d Add general Authentication combinators 2016-03-09 00:15:14 +01:00
aaron levin 6dc577c821 Add basic-auth data types to servant core 2016-03-08 23:08:17 +01:00
Sönke Hahn 8ef4d4543b renaming: Config -> Context 2016-03-07 23:12:24 +08:00
Sönke Hahn 67315c4487 server: added Config machinery 2016-01-21 17:55:02 +01:00
Julian K. Arni f1b6603c52 Review fixes 2016-01-08 18:03:28 +01:00
Julian K. Arni 783a849c67 Make NoContent still take an arg.
For consistency with other combinators, and to make using headers
        easier.
2016-01-07 14:30:08 +01:00
Julian K. Arni 574e9c48cd Export all Verb methods. 2016-01-07 13:47:08 +01:00
Julian K. Arni cda8bcf17c Simplify verb combinators.
Create a single 'Verb' combinator with parameters for status code and
        method. Make existing combinators type synonyms of 'Verb'.
2016-01-07 13:47:07 +01:00
Julian K. Arni afc76b8f6c Remove MatrixParam.
In servant, servant-server, and servant-client.
2015-10-13 21:37:07 +02:00
Nickolay Kudasov 40d2c68897 Use http-api-data package instead of ToText/FromText 2015-10-08 00:38:47 +03:00
Julian K. Arni 6eb7add53a stylish haskell changes
And import fix.
2015-08-18 00:07:12 +02:00
Alp Mestanogullari f39d57c6b3 add HttpVersion, IsSecure, RemoteHost and Vault combinators with instances for all interpretations (all but the server ones being 'ignore that combinator')
tighter version bounds for network

cleanup

document the new combinators

servant-server: add some tests for HttpVersion, IsSecure, RemoteHost and Vault

update changelogs

address Julian's feedback

remove vault test in servant-server

servant-server tests: -Werror friendly
2015-07-10 14:00:01 +02:00
Julian K. Arni 92d65aaf49 -Wall fixes 2015-05-03 13:36:51 +02:00
Julian K. Arni 50b05860b7 Remove Canonicalize 2015-05-03 01:45:17 +02:00
Julian K. Arni 1447221a16 Fixes for ServantErr in servant-client 2015-05-03 01:16:38 +02:00
Julian K. Arni 666e670058 Servant-blaze and servant-lucid 2015-05-02 12:04:47 +02:00
Julian K. Arni 5531ada22b Headers for all 2015-05-02 02:21:03 +01:00