1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 14:21:31 +03:00

🔥 getK.

This commit is contained in:
Rob Rix 2017-03-10 10:35:23 -05:00
parent 7f932559cf
commit d582bcb435

View File

@ -90,12 +90,6 @@ middleSnake as bs = M (MiddleSnake as bs) `Then` return
data MyersState = MyersState { forward :: !(Vector.Vector Int), backward :: !(Vector.Vector Int), offset :: Diagonal } data MyersState = MyersState { forward :: !(Vector.Vector Int), backward :: !(Vector.Vector Int), offset :: Diagonal }
getK :: Direction -> Diagonal -> Myers Endpoint
getK direction (Diagonal diagonal) = do
MyersState forward backward (Diagonal offset) <- get
let v = case direction of { Forward -> forward ; Reverse -> backward }
return $! v `at` (offset + diagonal)
at :: Vector.Vector Int -> Int -> Endpoint at :: Vector.Vector Int -> Int -> Endpoint
at v k = Endpoint (v Vector.! k) 0 at v k = Endpoint (v Vector.! k) 0