Created
November 10, 2014 20:08
-
-
Save CraigStuntz/7080d576e0dd982ea8b5 to your computer and use it in GitHub Desktop.
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
let private listWithDifferences (items: 'T list) = | |
let rec impl (accum, start: 'T list, rest: 'T list) = | |
match rest with | |
| [] -> accum | |
| head :: tail -> impl((head, start @ tail) :: accum, start @ [ head ], tail) | |
impl([], [], items) |> List.rev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment