Skip to content

Instantly share code, notes, and snippets.

@ConnorBaker
Last active February 23, 2019 00:52
Show Gist options
  • Select an option

  • Save ConnorBaker/61af0b926daf1b292cefd84db46fcbf6 to your computer and use it in GitHub Desktop.

Select an option

Save ConnorBaker/61af0b926daf1b292cefd84db46fcbf6 to your computer and use it in GitHub Desktop.
Programming in Haskell, 2nd ed.: Chapter 4: Problem 1
{-
As interesting side reading, consult https://www.reddit.com/r/haskell/comments/1m9opl/passing_list_as_arguments/
-}
halve :: [a] -> ([a],[a])
halve xs = splitAt (((length xs) + 1) `div` 2) xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment