Commit Graph

22 Commits

Author SHA1 Message Date
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
Oleg Grenrus cfade67c2f Cleanup pre-GHC-8.0 stuff 2018-07-11 01:39:38 +03:00
Oleg Grenrus f9bcc15d0b Apply stylish-haskell on all modules 2018-06-29 23:36:39 +03:00
Oleg Grenrus 0ae673583b Bump lower bounds in `servant`
- `text` is already 1.2.3.0 as https://github.com/fpco/stackage/issues/3147
  is resolved AFAICS

- `http-types` bound is surprisingly low due:
  https://github.com/fpco/stackage/issues/2976
2018-01-25 15:06:14 +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
Michael Sloan e38892a084 Remove usage of default exts, now "stack ghci" loads all together 2018-01-17 21:16:38 -08:00
Dimitri Sabadie c1371dd84d Temporary fix for Header. (#843)
servant-foreign: make foreign client Header arguments have the representation of 'Maybe' in those languages
2017-11-27 00:23:55 +01:00
David Turner e73f00b333 Test that no foreign functions are generated for an EmptyAPI 2017-05-16 10:31:33 +00:00
David Turner 113561639a Fix name of test 2017-05-16 10:31:02 +00:00
Oleg Grenrus da1b1980eb Add ComprehensiVeAPI test for servant-foreign 2017-01-20 00:09:54 +02:00
Oleg Grenrus 77f69101fb Add changelog and resurrect one test (higlights the change) 2017-01-16 11:53:14 +02:00
Dario Bertini c20c09411d Fix javascript function name generation, mostly fixes #191
and remove js-specific code in servant-foreign (code which would now be dead)
2017-01-16 11:47:55 +02:00
Jonathan Lange cda31614bf servant-foreign support for CaptureAll 2016-07-11 14:47:05 +01:00
Arian van Putten 05379ed7e3 Replace all occurances of () with NoContent
We use NoContent to signify an empty response nowadays. This commit
replaces all occurences of () with NoContent so that all packages use
the new semantics.
2016-07-10 16:58:59 +02:00
Steve Purcell 5188e842a9 [servant-foreign] Parameterise type classes with a foreign representation type
We allow a user-specified type to represent the foreign type of haskell
types encountered in the API. This lets users map Integer, Date etc. to
representations other than Text, and have those representations
available in the returned list of Req.

For example, we might want to map a type which has an instance of
Generic to both a foreign type name and a class declaration for that
foreign type such that it can encode/decode itself to JSON. The previous
limitation to a single Text output prevented this case.
2016-03-14 10:34:53 +13:00
Steve Purcell 207f05e759 [servant-foreign] Parameterise Req with a foreign type 2016-03-13 18:35:49 +13:00
Denis Redozubov e5635a044e use newtypes in servant-foreign 2016-03-12 12:51:22 +03:00
Denis Redozubov e6e13fde84 Make servant-foreign code nicer
* non-messy imports
* got rid of most long lines (>80 chars)
* prisms for sum types and newtypes(we use lens anyway, so why not)
* consistent indentation
2016-02-11 15:26:01 +03:00
Julian K. Arni bd77b4acba Verb for -mock, -js and -foreign. 2016-01-07 13:47:08 +01:00
Maksymilian Owsianny b6ee20dfe0 Fix to support GHC < 710 2015-12-02 13:02:05 +00:00
Maksymilian Owsianny e56fc650c2 Added test spec for servant-foreign. 2015-12-02 12:28:04 +00:00
Matt Bray aa2b56d08c servant-foreign: add test for camelCase 2015-11-04 11:27:07 +00:00