Skip to content

Commit ee4baa6

Browse files
committed
Optional ReqBody': Replace “bimap” with “first”
1 parent a2c0a55 commit ee4baa6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import Control.Monad.Trans
4141
import Control.Monad.Trans.Resource
4242
(runResourceT)
4343
import Data.Bifunctor
44-
(bimap)
44+
(first)
4545
import qualified Data.ByteString as B
4646
import qualified Data.ByteString.Builder as BB
4747
import qualified Data.ByteString.Char8 as BC8
@@ -691,11 +691,11 @@ instance ( AllCTUnrender list a, HasServer api context
691691
in
692692
fmap f (liftIO $ lazyRequestBody request) >>=
693693
case (sbool :: SBool (FoldRequired mods), sbool :: SBool (FoldLenient mods), hasReqBody) of
694-
(STrue, STrue, _) -> return . bimap cs id
694+
(STrue, STrue, _) -> return . first cs
695695
(STrue, SFalse, _) -> either (delayedFailFatal . serverErr) return
696696
(SFalse, STrue, False) -> return . either (const Nothing) (Just . Right)
697697
(SFalse, SFalse, False) -> return . either (const Nothing) Just
698-
(SFalse, STrue, True) -> return . Just . bimap cs id
698+
(SFalse, STrue, True) -> return . Just . first cs
699699
(SFalse, SFalse, True) -> either (delayedFailFatal . serverErr) (return . Just)
700700

701701
instance

0 commit comments

Comments
 (0)