Skip to content

Instantly share code, notes, and snippets.

@shigemk2
Created October 25, 2014 17:16
Show Gist options
  • Select an option

  • Save shigemk2/5d7d2e6455fc016b7f13 to your computer and use it in GitHub Desktop.

Select an option

Save shigemk2/5d7d2e6455fc016b7f13 to your computer and use it in GitHub Desktop.
mtake x =
take key x
where
key = (div (length x - 1) 2) + 1
mdrop x =
drop key x
where
key = (div (length x - 1) 2) + 1
main = do
print $ mtake x
print $ mdrop x
where
x = [1,2,3,4,5,6]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment