Skip to content

Commit d4fe0e5

Browse files
committed
Fix stylistic issues
1 parent 2caabad commit d4fe0e5

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ instance Monad RouteResult where
5353
newtype RouteResultT m a = RouteResultT { runRouteResultT :: m (RouteResult a) }
5454
deriving (Functor)
5555

56-
-- As we write these instances, we get instances for `DelayedIO` with GND.
5756
instance MonadTrans RouteResultT where
5857
lift = RouteResultT . liftM Route
5958

@@ -89,8 +88,6 @@ instance MonadTransControl RouteResultT where
8988
instance MonadThrow m => MonadThrow (RouteResultT m) where
9089
throwM = lift . throwM
9190

92-
-- instance MonadCatch m => MonadCatch (RouteResultT m) where
93-
-- instance MonadError ServantErr (RouteResultT m) where
9491

9592
toApplication :: RoutingApplication -> Application
9693
toApplication ra request respond = ra request routingRespond
@@ -189,8 +186,8 @@ newtype DelayedIO a = DelayedIO { runDelayedIO' :: ReaderT Request (ResourceT (R
189186
, MonadResource
190187
)
191188

192-
returnRouteResult :: RouteResult a -> DelayedIO a
193-
returnRouteResult x = DelayedIO $ lift . lift $ RouteResultT . return $ x
189+
liftRouteResult :: RouteResult a -> DelayedIO a
190+
liftRouteResult x = DelayedIO $ lift . lift $ RouteResultT . return $ x
194191

195192
instance MonadBaseControl IO DelayedIO where
196193
type StM DelayedIO a = StM (ReaderT Request (ResourceT (RouteResultT IO))) a
@@ -209,11 +206,11 @@ emptyDelayed result =
209206

210207
-- | Fail with the option to recover.
211208
delayedFail :: ServantErr -> DelayedIO a
212-
delayedFail err = returnRouteResult $ Fail err
209+
delayedFail err = liftRouteResult $ Fail err
213210

214211
-- | Fail fatally, i.e., without any option to recover.
215212
delayedFailFatal :: ServantErr -> DelayedIO a
216-
delayedFailFatal err = returnRouteResult $ FailFatal err
213+
delayedFailFatal err = liftRouteResult $ FailFatal err
217214

218215
-- | Gain access to the incoming request.
219216
withRequest :: (Request -> DelayedIO a) -> DelayedIO a
@@ -311,7 +308,7 @@ runDelayed Delayed{..} env req =
311308
a <- authD
312309
b <- bodyD
313310
r <- ask
314-
returnRouteResult (serverD c a b r)
311+
liftRouteResult (serverD c a b r)
315312
)
316313
req
317314

0 commit comments

Comments
 (0)