1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 08:54:07 +03:00

Give a pointfree definition of getK.

This commit is contained in:
Rob Rix 2017-06-13 21:00:45 -04:00
parent 767a2a36a4
commit 2078aca839

View File

@ -72,7 +72,7 @@ runSES eq (EditGraph as bs)
where -- | Search an edit graph for the shortest edit script along a specific diagonal, moving onto a given diagonal from one of its in-bounds adjacent diagonals (if any), and sliding down any diagonal edges eagerly. where -- | Search an edit graph for the shortest edit script along a specific diagonal, moving onto a given diagonal from one of its in-bounds adjacent diagonals (if any), and sliding down any diagonal edges eagerly.
searchAlongK (Diagonal k) = do searchAlongK (Diagonal k) = do
v <- get v <- get
let getK k = let (x, script) = v ! Diagonal k in Endpoint x script let getK = uncurry Endpoint . (v !) . Diagonal
let Endpoint x' script = slideFrom $! if d == 0 || k < negate m || k > n then let Endpoint x' script = slideFrom $! if d == 0 || k < negate m || k > n then
-- The top-left corner, or otherwise out-of-bounds. -- The top-left corner, or otherwise out-of-bounds.
Endpoint 0 [] Endpoint 0 []