mirror of
https://github.com/github/semantic.git
synced 2025-01-03 04:51:57 +03:00
Step-by-step computation of Myers’ algorithm.
This commit is contained in:
parent
5a7cd8d6ab
commit
532b402d34
@ -31,6 +31,16 @@ data Direction = Forward | Reverse
|
||||
|
||||
-- Evaluation
|
||||
|
||||
runMyersStep :: MyersState -> Myers a -> Either a (MyersState, Myers a)
|
||||
runMyersStep state step = case step of
|
||||
Return a -> Left a
|
||||
Then step cont -> case step of
|
||||
M myers -> Right (state, decompose myers >>= cont)
|
||||
|
||||
S Get -> Right (state, cont state)
|
||||
S (Put state') -> Right (state', cont ())
|
||||
|
||||
|
||||
decompose :: MyersF a -> Myers a
|
||||
decompose myers = case myers of
|
||||
SES {} -> return []
|
||||
|
Loading…
Reference in New Issue
Block a user