-
-
Save killerswan/942108 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
(* Brian McNamara's approach isn't actually that bad, unless List had an efficient append. But simplify it like so... *) | |
let suffixesTR3 list = | |
let rec loop l acc = | |
match l with | |
| [] -> acc | |
| _::xs -> loop xs (xs :: acc) in | |
List.rev (loop list [list]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment