diff --git a/package.yaml b/package.yaml index 493ad1c..ea2c126 100644 --- a/package.yaml +++ b/package.yaml @@ -98,6 +98,7 @@ library: - ScopedTypeVariables - TypeOperators - RankNTypes + - BangPatterns ghc-options: - -Wall diff --git a/src/Tablebot/Plugins/Roll/Plugin.hs b/src/Tablebot/Plugins/Roll/Plugin.hs index 6bb81f2..eb03e1c 100644 --- a/src/Tablebot/Plugins/Roll/Plugin.hs +++ b/src/Tablebot/Plugins/Roll/Plugin.hs @@ -165,7 +165,7 @@ statsCommand = Command "stats" statsCommandParser [] return $ statsCommand' (firstE : restEs) statsCommand' :: [Expr] -> Message -> DatabaseDiscord () statsCommand' es m = do - mrange' <- liftIO $ timeout (oneSecond * 5) $ mapM (\e -> (,prettyShow e) <$> rangeExpr e) es + mrange' <- liftIO $ timeout (oneSecond * 5) $ mapM (\e -> rangeExpr e >>= \re -> re `seq` return (re, prettyShow e)) es case mrange' of Nothing -> throwBot (EvaluationException "Timed out calculating statistics" []) (Just range') -> do