Advertisement
Guest User

Reversing linked listed

a guest
Jan 20th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 0.21 KB | None | 0 0
  1. let reverseList input =
  2.     let rec reverseList' aList cont =
  3.         match aList with
  4.         | [] -> []
  5.         | hd::[] -> hd::cont()
  6.         | hd::tail ->
  7.             reverseList' tail (fun () -> hd::cont())
  8.     reverseList' input (fun () -> [])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement