summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--edit-lens/src/Data/String/DFST.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/edit-lens/src/Data/String/DFST.hs b/edit-lens/src/Data/String/DFST.hs
index 2eeb368..54a1336 100644
--- a/edit-lens/src/Data/String/DFST.hs
+++ b/edit-lens/src/Data/String/DFST.hs
@@ -19,7 +19,7 @@ import Control.Monad
19 19
20data DFST state = DFST 20data DFST state = DFST
21 { stInitial :: state 21 { stInitial :: state
22 , stTransition :: Map (state, Char) (state, Maybe Char) 22 , stTransition :: Map (state, Char) (state, String)
23 -- ^ All @(s, c)@-combinations not mapped are assumed to map to @(s, Nothing)@ 23 -- ^ All @(s, c)@-combinations not mapped are assumed to map to @(s, Nothing)@
24 , stAccept :: Set state 24 , stAccept :: Set state
25 } 25 }
@@ -37,6 +37,6 @@ runDFST' :: forall state. Ord state
37runDFST' _ st [] acc = (st, acc) 37runDFST' _ st [] acc = (st, acc)
38runDFST' dfst@DFST{..} st (c:cs) acc 38runDFST' dfst@DFST{..} st (c:cs) acc
39 | Just (st', mc') <- stTransition !? (st, c) 39 | Just (st', mc') <- stTransition !? (st, c)
40 = runDFST' dfst st' cs $ acc . maybe id (:) mc' 40 = runDFST' dfst st' cs $ acc . (mc' ++)
41 | otherwise 41 | otherwise
42 = runDFST' dfst st cs acc 42 = runDFST' dfst st cs acc