1
1
mirror of https://github.com/github/semantic.git synced 2025-01-09 00:56:32 +03:00

Add runJoinWith to extract-and-apply Join.

This commit is contained in:
Rob Rix 2016-03-24 14:24:02 -04:00
parent f2bd582dfb
commit 606b5b48c8

View File

@ -149,6 +149,9 @@ modifyJoin f = Join . f . runJoin
bimapJoin :: Bifunctor p => (a -> b) -> (a -> b) -> Join p a -> Join p b
bimapJoin f g = modifyJoin $ bimap f g
runJoinWith :: (p a a -> b) -> Join p a -> b
runJoinWith f = f . runJoin
intersects :: Range -> Range -> Bool
intersects a b = max (start a) (start b) < min (end a) (end b)