diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2018-05-07 10:33:41 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2018-05-07 10:33:41 +0200 |
commit | b55258d2b5609aea500fb0b011c87e9e1585cbb0 (patch) | |
tree | c19a13790cf7cb302378852c7273041a6f1f5720 /edit-lens/src | |
parent | dcadfe75a6b169df94d815eaa85f8eedea189ea4 (diff) | |
download | incremental-dfsts-b55258d2b5609aea500fb0b011c87e9e1585cbb0.tar incremental-dfsts-b55258d2b5609aea500fb0b011c87e9e1585cbb0.tar.gz incremental-dfsts-b55258d2b5609aea500fb0b011c87e9e1585cbb0.tar.bz2 incremental-dfsts-b55258d2b5609aea500fb0b011c87e9e1585cbb0.tar.xz incremental-dfsts-b55258d2b5609aea500fb0b011c87e9e1585cbb0.zip |
Improve doc of DFST
Diffstat (limited to 'edit-lens/src')
-rw-r--r-- | edit-lens/src/Data/String/DFST.hs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/edit-lens/src/Data/String/DFST.hs b/edit-lens/src/Data/String/DFST.hs index 702a0d8..2eeb368 100644 --- a/edit-lens/src/Data/String/DFST.hs +++ b/edit-lens/src/Data/String/DFST.hs | |||
@@ -28,7 +28,12 @@ runDFST :: forall state. Ord state => DFST state -> String -> Maybe String | |||
28 | runDFST dfst@DFST{..} str = let (finalState, str') = runDFST' dfst stInitial str id | 28 | runDFST dfst@DFST{..} str = let (finalState, str') = runDFST' dfst stInitial str id |
29 | in str' "" <$ guard (finalState `Set.member` stAccept) | 29 | in str' "" <$ guard (finalState `Set.member` stAccept) |
30 | 30 | ||
31 | runDFST' :: forall state. Ord state => DFST state -> state -> String -> (String -> String) -> (state, (String -> String)) | 31 | runDFST' :: forall state. Ord state |
32 | => DFST state | ||
33 | -> state -- ^ Current state | ||
34 | -> String -- ^ Remaining input | ||
35 | -> (String -> String) -- ^ Output as difference list | ||
36 | -> (state, (String -> String)) -- ^ Next state, altered output | ||
32 | runDFST' _ st [] acc = (st, acc) | 37 | runDFST' _ st [] acc = (st, acc) |
33 | runDFST' dfst@DFST{..} st (c:cs) acc | 38 | runDFST' dfst@DFST{..} st (c:cs) acc |
34 | | Just (st', mc') <- stTransition !? (st, c) | 39 | | Just (st', mc') <- stTransition !? (st, c) |