Commit abeda23
committed
Make Verb and NoContentVerb HasServer instances delegate to MultiVerb
This is the first step toward unifying endpoint types around MultiVerb.
Changes:
- Verb's HasServer instances now delegate to MultiVerb
- NoContentVerb delegates to MultiVerb with RespondAs '() 204
- Verb and NoContentVerb method parameter changed from polymorphic (k1)
to strict (StdMethod) for consistency with MultiVerb.
This is a breaking change, but arguably not a major one: I doubt that
this extra polymorphism was ever used.
- Added KnownStatus constraint to Verb instances. We previously only required `KnownNat`,
but we need `KnownStatus` to be able to express `Verb` in terms of `MultiVerb.
This is another potential breaking change: users using non-standard, custom statuses will
have to implement `KnownStatus` instances.
- Added ResponseRender instance for Respond with Headers to support
the delegation
Removed dead code:
- methodRouter (was only used by Verb)
- noContentRouter (was only used by NoContentVerb)
- responseLBS import (no longer needed)
Test changes:
- Added KnownStatus instances for non-standard test status codes
(210, 214, 280)1 parent e5610be commit abeda23
File tree
5 files changed
+53
-65
lines changed- servant-server
- src/Servant/Server
- Internal
- test/Servant
- servant/src/Servant/API
5 files changed
+53
-65
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
| 113 | + | |
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
369 | 369 | | |
370 | 370 | | |
371 | 371 | | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | 372 | | |
417 | 373 | | |
418 | 374 | | |
419 | | - | |
| 375 | + | |
| 376 | + | |
420 | 377 | | |
421 | 378 | | |
422 | 379 | | |
423 | 380 | | |
424 | 381 | | |
425 | 382 | | |
426 | 383 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
| 384 | + | |
431 | 385 | | |
432 | 386 | | |
433 | 387 | | |
434 | 388 | | |
| 389 | + | |
435 | 390 | | |
436 | | - | |
| 391 | + | |
437 | 392 | | |
438 | 393 | | |
439 | 394 | | |
440 | 395 | | |
441 | 396 | | |
442 | 397 | | |
443 | 398 | | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
| 399 | + | |
448 | 400 | | |
449 | 401 | | |
450 | 402 | | |
| |||
453 | 405 | | |
454 | 406 | | |
455 | 407 | | |
456 | | - | |
457 | | - | |
458 | | - | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
459 | 411 | | |
460 | 412 | | |
461 | 413 | | |
| |||
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
154 | 155 | | |
155 | 156 | | |
156 | 157 | | |
| 158 | + | |
157 | 159 | | |
158 | 160 | | |
159 | 161 | | |
| |||
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
179 | 204 | | |
180 | 205 | | |
181 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
118 | 119 | | |
119 | 120 | | |
120 | 121 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
159 | 166 | | |
160 | 167 | | |
161 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | 2 | | |
5 | 3 | | |
6 | 4 | | |
| |||
12 | 10 | | |
13 | 11 | | |
14 | 12 | | |
15 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
16 | 20 | | |
17 | 21 | | |
18 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments