Last active
January 4, 2016 13:49
-
-
Save cohalz/8630407 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 rec take lst n = | |
match (lst,n) with | |
| ([],_) -> [] | |
| (x::xs,m) -> if m <= 0 then [] else x::(take xs) (m-1) | |
let rec drop lst n = | |
match (lst,n) with | |
| ([],_) -> [] | |
| (x::xs,m) -> if m > 1 then take xs (m-1) else xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment