From 33ea980dbaf073b849d59ab752e8afff211b2ab9 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Wed, 22 Jun 2016 18:45:46 +0300 Subject: [PATCH] Simplify away from returnDeepSessionMap --- yesod-core/Yesod/Core/Internal/Run.hs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/yesod-core/Yesod/Core/Internal/Run.hs b/yesod-core/Yesod/Core/Internal/Run.hs index bdc2f2eb..0df2cdd8 100644 --- a/yesod-core/Yesod/Core/Internal/Run.hs +++ b/yesod-core/Yesod/Core/Internal/Run.hs @@ -47,17 +47,6 @@ import Yesod.Core.Internal.Util (getCurrentMaxExpiresRFC1123) import Yesod.Routes.Class (Route, renderRoute) import Control.DeepSeq (($!!)) -returnDeepSessionMap :: Monad m => SessionMap -> m SessionMap -#if MIN_VERSION_bytestring(0, 10, 0) -returnDeepSessionMap sm = return $!! sm -#else -returnDeepSessionMap sm = fmap unWrappedBS `liftM` (return $!! fmap WrappedBS sm) - --- | Work around missing NFData instance for bytestring 0.9. -newtype WrappedBS = WrappedBS { unWrappedBS :: S8.ByteString } -instance NFData WrappedBS -#endif - -- | Catch all synchronous exceptions, ignoring asynchronous -- exceptions. -- @@ -117,7 +106,7 @@ runHandler rhe@RunHandlerEnv {..} handler yreq = withInternalState $ \resState - state <- liftIO $ I.readIORef istate (finalSession, mcontents1) <- (do - finalSession <- returnDeepSessionMap (ghsSession state) + finalSession <- evaluate $!! ghsSession state return (finalSession, Nothing)) `catchSync` \e -> return (Map.empty, Just $! HCError $! InternalError $! T.pack $! show e)