Last active
November 22, 2019 18:43
-
-
Save aka-mj/386b1c04850e4a01ad4d1403b5f1afc3 to your computer and use it in GitHub Desktop.
Reverse a list in F#
This file contains 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 reverse lst' = | |
let rec rev acc = function | |
| [] -> acc | |
| head::tail -> rev (head::acc) tail | |
rev [] lst' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment