Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Created September 9, 2017 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/ce7279c010e340b5d500fa1f5ea410fe to your computer and use it in GitHub Desktop.
Save deque-blog/ce7279c010e340b5d500fa1f5ea410fe to your computer and use it in GitHub Desktop.
empty :: Shape coord
empty = Shape (const False)
superposeAll :: Foldable f => f (Shape coord) -> Shape coord
superposeAll shapes = Shape $ \coord -> any (`isInShape` coord) shapes
superpose :: Shape coord -> Shape coord -> Shape coord
superpose s1 s2 = superposeAll [s1, s2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment