diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-05 15:01:38 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-06-05 15:01:38 +0200 |
commit | 57f3d1b269a293c5a4cc3b74c3d349b093cf0298 (patch) | |
tree | 8949add81368e48bd20aca75ffa7b2d9b3bf50ee /src | |
parent | f434263fcce697f29c668a1c9ac2f05a1de1012c (diff) | |
download | 2017-01-16_17:13:37-57f3d1b269a293c5a4cc3b74c3d349b093cf0298.tar 2017-01-16_17:13:37-57f3d1b269a293c5a4cc3b74c3d349b093cf0298.tar.gz 2017-01-16_17:13:37-57f3d1b269a293c5a4cc3b74c3d349b093cf0298.tar.bz2 2017-01-16_17:13:37-57f3d1b269a293c5a4cc3b74c3d349b093cf0298.tar.xz 2017-01-16_17:13:37-57f3d1b269a293c5a4cc3b74c3d349b093cf0298.zip |
Allow asking the same question multiple times
Diffstat (limited to 'src')
-rw-r--r-- | src/Sequence/Formula.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Sequence/Formula.hs b/src/Sequence/Formula.hs index 7fb4ccb..e860c53 100644 --- a/src/Sequence/Formula.hs +++ b/src/Sequence/Formula.hs | |||
@@ -80,7 +80,7 @@ evalFormula = evalFormula' [] | |||
80 | 80 | ||
81 | val :: Integral a => Traversal' input (Formula input) -> String -> Bool -> Formula input | 81 | val :: Integral a => Traversal' input (Formula input) -> String -> Bool -> Formula input |
82 | val answer prompt keepResult = do | 82 | val answer prompt keepResult = do |
83 | gets (Set.member prompt) >>= bool (modify $ Set.insert prompt) (throwError Question{..}) | 83 | gets (Set.member prompt) >>= bool (modify $ Set.insert prompt) (modify (Set.delete prompt) >> throwError Question{..}) |
84 | preview answer >>= maybe (throwError Question{..}) id | 84 | preview answer >>= maybe (throwError Question{..}) id |
85 | 85 | ||
86 | -- viewL :: Lens' lInput sInput -> Prism' (FormulaM sInput a) (FormulaM lInput a) | 86 | -- viewL :: Lens' lInput sInput -> Prism' (FormulaM sInput a) (FormulaM lInput a) |