Skip to content

Instantly share code, notes, and snippets.

@CraigStuntz
Created November 10, 2014 20:08
Show Gist options
  • Save CraigStuntz/7080d576e0dd982ea8b5 to your computer and use it in GitHub Desktop.
Save CraigStuntz/7080d576e0dd982ea8b5 to your computer and use it in GitHub Desktop.
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