mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Model the state in Myers’ algorithm.
This commit is contained in:
parent
384e016262
commit
a400c8f2af
@ -11,7 +11,13 @@ data MyersF a where
|
||||
MiddleSnake :: Vector.Vector a -> Vector.Vector a -> MyersF (Snake, EditDistance)
|
||||
FindDPath :: Direction -> EditDistance -> Diagonal -> MyersF Endpoint
|
||||
|
||||
type Myers = Freer MyersF
|
||||
data StepF a where
|
||||
M :: MyersF a -> StepF a
|
||||
S :: State (MyersState a) a -> StepF a
|
||||
|
||||
data MyersState a = MyersState { forward :: !(Vector.Vector a), backward :: !(Vector.Vector a) }
|
||||
|
||||
type Myers = Freer StepF
|
||||
|
||||
data Snake = Snake { xy :: Endpoint, uv :: Endpoint }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user