Skip to content

Instantly share code, notes, and snippets.

@spolischook
Created August 21, 2015 01:22
Show Gist options
  • Select an option

  • Save spolischook/95dd01ad65ca4a46adce to your computer and use it in GitHub Desktop.

Select an option

Save spolischook/95dd01ad65ca4a46adce to your computer and use it in GitHub Desktop.
right implementation take with recursion
take' :: Int -> [Int] -> [Int]
take' x [] = []
take' 0 xs = []
take' x (xx:xxs)
| x <= 0 = []
| otherwise = xx : take' (x-1) xxs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment