From 57f3d1b269a293c5a4cc3b74c3d349b093cf0298 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 5 Jun 2016 15:01:38 +0200 Subject: Allow asking the same question multiple times --- src/Sequence/Formula.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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' [] val :: Integral a => Traversal' input (Formula input) -> String -> Bool -> Formula input val answer prompt keepResult = do - gets (Set.member prompt) >>= bool (modify $ Set.insert prompt) (throwError Question{..}) + gets (Set.member prompt) >>= bool (modify $ Set.insert prompt) (modify (Set.delete prompt) >> throwError Question{..}) preview answer >>= maybe (throwError Question{..}) id -- viewL :: Lens' lInput sInput -> Prism' (FormulaM sInput a) (FormulaM lInput a) -- cgit v1.2.3