Created
February 23, 2017 18:55
-
-
Save monkieboy/c367566c8f6e905620791b41c1ec74d4 to your computer and use it in GitHub Desktop.
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 rotateList amount initialList = | |
let rec rotate amount myList = | |
if amount = 0 | |
then myList |> List.rev | |
else | |
let newestList = | |
match myList |> List.rev with | |
| h::rest -> | |
let newList = (rest@[h]) |> List.rev | |
rotate (amount-1) newList | |
| [] -> [] | |
newestList | |
rotate amount initialList | |
let skip amount ( lst : string list ) = lst.[amount..] | |
let take toIndex ( lst : string list ) = lst.[..toIndex] | |
let range amount = [0..amount..200] | |
skip 2 ["a";"b";"c";"d";"e";"f"] | |
take 3 ["a";"b";"c";"d";"e";"f"] | |
range 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment