Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. thingfunction4 inBounds exBounds = foldl (\res exBound -> (\ll -> let merge p1@(a1,b1) p2@(a2,b2) = if b1<b2 then [p1, p2] else if a1<a2 then [(a1, b2)] else [p2] in let l2 = sortOn snd . concat $ ll in foldr (\a (b:rest) -> merge a b ++ rest) [last l2] . init $ l2) [(\(ia, ib) (ea, eb) -> if ib < ea || ia > eb then [(ia, ib)] else if ia > ea then if ib < eb then [] else [(eb, ib)] else if ib > eb then [(ia, ea), (eb, ib)] else [(ia, ea)]) x exBound| x <- res]) inBounds exBounds
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement