mirror of
https://github.com/github/semantic.git
synced 2025-01-03 04:51:57 +03:00
Add a function to run all the steps in a myers algorithm.
This commit is contained in:
parent
c9354e38ff
commit
6aab59ba18
@ -55,6 +55,11 @@ runMyers eq = runAll $ MyersState (Vector.replicate 100 0) (Vector.replicate 100
|
|||||||
Left a -> a
|
Left a -> a
|
||||||
Right next -> uncurry runAll next
|
Right next -> uncurry runAll next
|
||||||
|
|
||||||
|
runMyersSteps :: HasCallStack => (a -> a -> Bool) -> MyersState -> Myers a b -> [(MyersState, Myers a b)]
|
||||||
|
runMyersSteps eq state step = let ?callStack = popCallStack callStack in (state, step) : case runMyersStep eq state step of
|
||||||
|
Left result -> [ (state, return result) ]
|
||||||
|
Right next -> uncurry (runMyersSteps eq) next
|
||||||
|
|
||||||
runMyersStep :: HasCallStack => (a -> a -> Bool) -> MyersState -> Myers a b -> Either b (MyersState, Myers a b)
|
runMyersStep :: HasCallStack => (a -> a -> Bool) -> MyersState -> Myers a b -> Either b (MyersState, Myers a b)
|
||||||
runMyersStep eq state step = let ?callStack = popCallStack callStack in case step of
|
runMyersStep eq state step = let ?callStack = popCallStack callStack in case step of
|
||||||
Return a -> Left a
|
Return a -> Left a
|
||||||
|
Loading…
Reference in New Issue
Block a user