mirror of
https://github.com/github/semantic.git
synced 2024-11-24 00:42:33 +03:00
Move moveDownFrom/moveRightFrom/slideFrom out a scope.
This commit is contained in:
parent
2ed1926f94
commit
8131dfaf75
@ -49,15 +49,15 @@ ses eq as' bs'
|
||||
else
|
||||
moveRightFrom left
|
||||
|
||||
-- | Move downward from a given vertex, inserting the element for the corresponding row.
|
||||
moveDownFrom (Endpoint x y script) = Endpoint x (succ y) (if y >= 0 && y < m then That (bs ! y) : script else script)
|
||||
-- | Move downward from a given vertex, inserting the element for the corresponding row.
|
||||
moveDownFrom (Endpoint x y script) = Endpoint x (succ y) (if y >= 0 && y < m then That (bs ! y) : script else script)
|
||||
|
||||
-- | Move rightward from a given vertex, deleting the element for the corresponding column.
|
||||
moveRightFrom (Endpoint x y script) = Endpoint (succ x) y (if x < n then This (as ! x) : script else script)
|
||||
-- | Move rightward from a given vertex, deleting the element for the corresponding column.
|
||||
moveRightFrom (Endpoint x y script) = Endpoint (succ x) y (if x < n then This (as ! x) : script else script)
|
||||
|
||||
-- | Slide down any diagonal edges from a given vertex.
|
||||
slideFrom (Endpoint x y script)
|
||||
| inRange (Array.bounds as) x, a <- as ! x
|
||||
, inRange (Array.bounds bs) y, b <- bs ! y
|
||||
, a `eq` b = slideFrom (Endpoint (succ x) (succ y) (These a b : script))
|
||||
| otherwise = Endpoint x y script
|
||||
-- | Slide down any diagonal edges from a given vertex.
|
||||
slideFrom (Endpoint x y script)
|
||||
| inRange (Array.bounds as) x, a <- as ! x
|
||||
, inRange (Array.bounds bs) y, b <- bs ! y
|
||||
, a `eq` b = slideFrom (Endpoint (succ x) (succ y) (These a b : script))
|
||||
| otherwise = Endpoint x y script
|
||||
|
Loading…
Reference in New Issue
Block a user