Skip to content

Commit 2ae5041

Browse files
committed
Merge pull request #362 from kosmikus/ks-cleanup
Various small and hopefully uncontroversial changes.
2 parents b9fb80a + 23a31a8 commit 2ae5041

File tree

2 files changed

+34
-34
lines changed

2 files changed

+34
-34
lines changed

servant-server/src/Servant/Server/Internal/RoutingApplication.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ toApplication ra request respond = do
9898
--
9999
-- There are two reasons:
100100
--
101-
-- 1. Currently, the order in which we perform checks coincides
102-
-- with the error we will generate. This is because during checks,
103-
-- once an error occurs, we do not perform any subsequent checks,
104-
-- but rather return this error.
101+
-- 1. In a straight-forward implementation, the order in which we
102+
-- perform checks will determine the error we generate. This is
103+
-- because once an error occurs, we would abort and not perform
104+
-- any subsequent checks, but rather return the current error.
105105
--
106106
-- This is not a necessity: we could continue doing other checks,
107107
-- and choose the preferred error. However, that would in general
@@ -159,7 +159,7 @@ data Delayed :: * -> * where
159159
-> Delayed c
160160

161161
instance Functor Delayed where
162-
fmap f (Delayed a b c g) = Delayed a b c ((fmap.fmap.fmap) f g)
162+
fmap f (Delayed a b c g) = Delayed a b c ((fmap . fmap . fmap) f g)
163163

164164
-- | Add a capture to the end of the capture block.
165165
addCapture :: Delayed (a -> b)
@@ -240,9 +240,9 @@ runAction :: Delayed (ExceptT ServantErr IO a)
240240
-> IO r
241241
runAction action respond k = runDelayed action >>= go >>= respond
242242
where
243-
go (Fail e) = return $ Fail e
243+
go (Fail e) = return $ Fail e
244244
go (FailFatal e) = return $ FailFatal e
245-
go (Route a) = do
245+
go (Route a) = do
246246
e <- runExceptT a
247247
case e of
248248
Left err -> return . Route $ responseServantErr err

servant/src/Servant/API/Verbs.hs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ data Verb (method :: k1) (statusCode :: Nat) (contentTypes :: [*]) a
3434
-- the relevant information is summarily presented here.
3535

3636
-- | 'GET' with 200 status code.
37-
type Get contentTypes a = Verb 'GET 200 contentTypes a
37+
type Get = Verb 'GET 200
3838
-- | 'POST' with 200 status code.
39-
type Post contentTypes a = Verb 'POST 200 contentTypes a
39+
type Post = Verb 'POST 200
4040
-- | 'PUT' with 200 status code.
41-
type Put contentTypes a = Verb 'PUT 200 contentTypes a
41+
type Put = Verb 'PUT 200
4242
-- | 'DELETE' with 200 status code.
43-
type Delete contentTypes a = Verb 'DELETE 200 contentTypes a
43+
type Delete = Verb 'DELETE 200
4444
-- | 'PATCH' with 200 status code.
45-
type Patch contentTypes a = Verb 'PATCH 200 contentTypes a
45+
type Patch = Verb 'PATCH 200
4646

4747
-- * Other responses
4848

@@ -58,7 +58,7 @@ type Patch contentTypes a = Verb 'PATCH 200 contentTypes a
5858

5959
-- | 'POST' with 201 status code.
6060
--
61-
type PostCreated contentTypes a = Verb 'POST 201 contentTypes a
61+
type PostCreated = Verb 'POST 201
6262

6363

6464
-- ** 202 Accepted
@@ -69,15 +69,15 @@ type PostCreated contentTypes a = Verb 'POST 201 contentTypes a
6969
-- estimate of when the processing will be finished.
7070

7171
-- | 'GET' with 202 status code.
72-
type GetAccepted contentTypes a = Verb 'GET 202 contentTypes a
72+
type GetAccepted = Verb 'GET 202
7373
-- | 'POST' with 202 status code.
74-
type PostAccepted contentTypes a = Verb 'POST 202 contentTypes a
74+
type PostAccepted = Verb 'POST 202
7575
-- | 'DELETE' with 202 status code.
76-
type DeleteAccepted contentTypes a = Verb 'DELETE 202 contentTypes a
76+
type DeleteAccepted = Verb 'DELETE 202
7777
-- | 'PATCH' with 202 status code.
78-
type PatchAccepted contentTypes a = Verb 'PATCH 202 contentTypes a
78+
type PatchAccepted = Verb 'PATCH 202
7979
-- | 'PUT' with 202 status code.
80-
type PutAccepted contentTypes a = Verb 'PUT 202 contentTypes a
80+
type PutAccepted = Verb 'PUT 202
8181

8282

8383
-- ** 203 Non-Authoritative Information
@@ -86,15 +86,15 @@ type PutAccepted contentTypes a = Verb 'PUT 202 contentTypes a
8686
-- information may come from a third-party.
8787

8888
-- | 'GET' with 203 status code.
89-
type GetNonAuthoritative contentTypes a = Verb 'GET 203 contentTypes a
89+
type GetNonAuthoritative = Verb 'GET 203
9090
-- | 'POST' with 203 status code.
91-
type PostNonAuthoritative contentTypes a = Verb 'POST 203 contentTypes a
91+
type PostNonAuthoritative = Verb 'POST 203
9292
-- | 'DELETE' with 203 status code.
93-
type DeleteNonAuthoritative contentTypes a = Verb 'DELETE 203 contentTypes a
93+
type DeleteNonAuthoritative = Verb 'DELETE 203
9494
-- | 'PATCH' with 203 status code.
95-
type PatchNonAuthoritative contentTypes a = Verb 'PATCH 203 contentTypes a
95+
type PatchNonAuthoritative = Verb 'PATCH 203
9696
-- | 'PUT' with 203 status code.
97-
type PutNonAuthoritative contentTypes a = Verb 'PUT 203 contentTypes a
97+
type PutNonAuthoritative = Verb 'PUT 203
9898

9999

100100
-- ** 204 No Content
@@ -105,15 +105,15 @@ type PutNonAuthoritative contentTypes a = Verb 'PUT 203 contentTypes a
105105
-- If the document view should be reset, use @205 Reset Content@.
106106

107107
-- | 'GET' with 204 status code.
108-
type GetNoContent contentTypes noContent = Verb 'GET 204 contentTypes noContent
108+
type GetNoContent = Verb 'GET 204
109109
-- | 'POST' with 204 status code.
110-
type PostNoContent contentTypes noContent = Verb 'POST 204 contentTypes noContent
110+
type PostNoContent = Verb 'POST 204
111111
-- | 'DELETE' with 204 status code.
112-
type DeleteNoContent contentTypes noContent = Verb 'DELETE 204 contentTypes noContent
112+
type DeleteNoContent = Verb 'DELETE 204
113113
-- | 'PATCH' with 204 status code.
114-
type PatchNoContent contentTypes noContent = Verb 'PATCH 204 contentTypes noContent
114+
type PatchNoContent = Verb 'PATCH 204
115115
-- | 'PUT' with 204 status code.
116-
type PutNoContent contentTypes noContent = Verb 'PUT 204 contentTypes noContent
116+
type PutNoContent = Verb 'PUT 204
117117

118118

119119
-- ** 205 Reset Content
@@ -124,15 +124,15 @@ type PutNoContent contentTypes noContent = Verb 'PUT 204 contentTypes noContent
124124
-- If the document view should not be reset, use @204 No Content@.
125125

126126
-- | 'GET' with 205 status code.
127-
type GetResetContent contentTypes noContent = Verb 'GET 205 contentTypes noContent
127+
type GetResetContent = Verb 'GET 205
128128
-- | 'POST' with 205 status code.
129-
type PostResetContent contentTypes noContent = Verb 'POST 205 contentTypes noContent
129+
type PostResetContent = Verb 'POST 205
130130
-- | 'DELETE' with 205 status code.
131-
type DeleteResetContent contentTypes noContent = Verb 'DELETE 205 contentTypes noContent
131+
type DeleteResetContent = Verb 'DELETE 205
132132
-- | 'PATCH' with 205 status code.
133-
type PatchResetContent contentTypes noContent = Verb 'PATCH 205 contentTypes noContent
133+
type PatchResetContent = Verb 'PATCH 205
134134
-- | 'PUT' with 205 status code.
135-
type PutResetContent contentTypes noContent = Verb 'PUT 205 contentTypes noContent
135+
type PutResetContent = Verb 'PUT 205
136136

137137

138138
-- ** 206 Partial Content
@@ -144,7 +144,7 @@ type PutResetContent contentTypes noContent = Verb 'PUT 205 contentTypes noConte
144144
-- RFC7233 Section 4.1>
145145

146146
-- | 'GET' with 206 status code.
147-
type GetPartialContent contentTypes noContent = Verb 'GET 206 contentTypes noContent
147+
type GetPartialContent = Verb 'GET 206
148148

149149

150150
class ReflectMethod a where

0 commit comments

Comments
 (0)