Skip to content

Instantly share code, notes, and snippets.

@tarquin-the-brave
Created May 12, 2020 12:41
Show Gist options
  • Save tarquin-the-brave/96a4ee0cfedbb41bd548ed89989367e2 to your computer and use it in GitHub Desktop.
Save tarquin-the-brave/96a4ee0cfedbb41bd548ed89989367e2 to your computer and use it in GitHub Desktop.
-- Which bodies do not orbit anything?
roots :: Eq a => [(a,a)] -> [a]
roots orbits = [x | (x, y) <- orbits, notElem x . fmap snd $ orbits]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment