mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
Add a function dividing a graph in two.
This commit is contained in:
parent
ec33d16355
commit
0e2f57821e
@ -138,6 +138,11 @@ continue = return Nothing
|
||||
ceilDiv :: Integral a => a -> a -> a
|
||||
ceilDiv = (uncurry (+) .) . divMod
|
||||
|
||||
divideGraph :: EditGraph a -> Endpoint -> (EditGraph a, EditGraph a)
|
||||
divideGraph (EditGraph as bs) (Endpoint x y) =
|
||||
( EditGraph (Vector.slice 0 x as) (Vector.slice 0 y bs)
|
||||
, EditGraph (Vector.slice x (length as - x) as) (Vector.slice y (length bs - y) bs) )
|
||||
|
||||
|
||||
-- Instances
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user