Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
intersectAll :: Foldable f => f (Shape coord) -> Shape coord
intersectAll shapes = Shape $ \coord -> all (`isInShape` coord) shapes
intersect :: Shape coord -> Shape coord -> Shape coord
intersect s1 s2 = intersectAll [s1, s2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment