1
1
mirror of https://github.com/github/semantic.git synced 2024-12-22 06:11:49 +03:00

Define a test of endpoint overlap.

This commit is contained in:
Rob Rix 2017-03-09 10:48:11 -05:00
parent 4ad49d4f82
commit 0624d24aa7

View File

@ -49,6 +49,9 @@ at v (Diagonal k) = do
Diagonal o <- gets offset
return (Endpoint (v Vector.! o + k, 0))
overlaps :: Endpoint -> Endpoint -> Bool
overlaps (Endpoint (x, y)) (Endpoint (u, v)) = x - y == u - v && x <= u
-- Instances