Press CTRL+C or CMD+C to copy the selected text and close this dialog.
Tweet
0 people like it. Like the snippet!
Find the k'th element of a list. (easy)
1: 2: 3: 4: 5: 6: 7: 8: 9:
let rec at i = function | h :: t when 1 < i -> at (i - 1) t | h :: t when 1 = i -> Some h | _ -> None at 2 [ "a" ; "b" ; "c" ; "d" ] at -1 [ "a" ; "b" ; "c" ; "d" ] at 2 [ "a" ] at 2 ([ ] : int list)