summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-06-05 15:01:38 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2016-06-05 15:01:38 +0200
commit57f3d1b269a293c5a4cc3b74c3d349b093cf0298 (patch)
tree8949add81368e48bd20aca75ffa7b2d9b3bf50ee
parentf434263fcce697f29c668a1c9ac2f05a1de1012c (diff)
download2017-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
-rw-r--r--src/Sequence/Formula.hs2
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
81val :: Integral a => Traversal' input (Formula input) -> String -> Bool -> Formula input 81val :: Integral a => Traversal' input (Formula input) -> String -> Bool -> Formula input
82val answer prompt keepResult = do 82val 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)