Created
April 26, 2011 06:39
-
-
Save mneedham/941892 to your computer and use it in GitHub Desktop.
Purely Functional Data Structures - Chris Okasaki
This file contains 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
let suffixesTR list = | |
let rec loop l acc = | |
match l with | |
| [] -> acc | |
| [last] -> loop [] (List.concat [acc; [[last]]; [[]]]) | |
| hd::tl -> loop tl (List.concat [acc; [l]]) | |
in | |
loop list [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment