Created
January 28, 2012 03:22
-
-
Save jordanlewis/1692330 to your computer and use it in GitHub Desktop.
PFDS Exercise 2.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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