Skip to content

Instantly share code, notes, and snippets.

@thednaz
thednaz / gist:2897337
Created June 8, 2012 18:08
F# list reverse
let rec reverse list =
match list with
|[] -> []
|[x] -> [x]
| head::tail -> reverse tail @ [head]
let rec rev list acc=
match list with
| [] -> acc
| [x] -> x::acc