summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-06-06 02:41:09 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2016-06-06 02:41:09 +0200
commit54624cecd73a0b1ae3b8c6de41808ca02b31179e (patch)
treeadebeb88499749969e6f56e10ddf3347c219b3ed /src/Main.hs
parentb0460c33fe676912b88de09f49956a4adf5c9752 (diff)
download2017-01-16_17:13:37-54624cecd73a0b1ae3b8c6de41808ca02b31179e.tar
2017-01-16_17:13:37-54624cecd73a0b1ae3b8c6de41808ca02b31179e.tar.gz
2017-01-16_17:13:37-54624cecd73a0b1ae3b8c6de41808ca02b31179e.tar.bz2
2017-01-16_17:13:37-54624cecd73a0b1ae3b8c6de41808ca02b31179e.tar.xz
2017-01-16_17:13:37-54624cecd73a0b1ae3b8c6de41808ca02b31179e.zip
Evaluate formulas in arbitrarily large context
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Main.hs b/src/Main.hs
index 06cc6ed..f4a863f 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -2,7 +2,7 @@
2 2
3import Control.Monad 3import Control.Monad
4 4
5import Control.Lens 5import Control.Lens hiding (Context(..))
6 6
7import System.Console.Shell 7import System.Console.Shell
8import System.Console.Shell.ShellMonad 8import System.Console.Shell.ShellMonad
@@ -146,7 +146,7 @@ rollTest = withArg $ enactTest' >=> maybe (return ()) (shellPutStrLn . ppResult)
146 146
147enactTest' :: (FormulaM Stats Test) -> Sh GameState (Maybe TestResult) 147enactTest' :: (FormulaM Stats Test) -> Sh GameState (Maybe TestResult)
148enactTest' test = withFocus' $ \focus -> do 148enactTest' test = withFocus' $ \focus -> do
149 (newStats, result) <- evalFormula (view eStats focus) (enactTest =<< test) 149 (newFocus, result) <- evalFormula focus (enactTest =<< test)
150 gFocus'.eStats .= newStats 150 gFocus' .= newFocus
151 return result 151 return result
152 152