From b55258d2b5609aea500fb0b011c87e9e1585cbb0 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Mon, 7 May 2018 10:33:41 +0200 Subject: Improve doc of DFST --- edit-lens/src/Data/String/DFST.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'edit-lens/src') 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 runDFST dfst@DFST{..} str = let (finalState, str') = runDFST' dfst stInitial str id in str' "" <$ guard (finalState `Set.member` stAccept) -runDFST' :: forall state. Ord state => DFST state -> state -> String -> (String -> String) -> (state, (String -> String)) +runDFST' :: forall state. Ord state + => DFST state + -> state -- ^ Current state + -> String -- ^ Remaining input + -> (String -> String) -- ^ Output as difference list + -> (state, (String -> String)) -- ^ Next state, altered output runDFST' _ st [] acc = (st, acc) runDFST' dfst@DFST{..} st (c:cs) acc | Just (st', mc') <- stTransition !? (st, c) -- cgit v1.2.3