Skip to content

Instantly share code, notes, and snippets.

@jordanlewis
Created January 28, 2012 03:22
Show Gist options
  • Save jordanlewis/1692330 to your computer and use it in GitHub Desktop.
Save jordanlewis/1692330 to your computer and use it in GitHub Desktop.
PFDS Exercise 2.1
def suffixes[A](xs: List[A]): List[List[A]] = xs match {
case Nil => Nil::Nil
case x::xs => (x::xs)::suffixes(xs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment