Skip to content

Instantly share code, notes, and snippets.

@apstndb
Created July 22, 2012 13:50
Show Gist options
  • Save apstndb/3159765 to your computer and use it in GitHub Desktop.
Save apstndb/3159765 to your computer and use it in GitHub Desktop.
oddEven implementation
oddEven :: [Int] -> ([Int],[Int])
oddEven [] = ([], [])
oddEven (x:xs) | odd x = (x:odds, evens)
| otherwise = (odds, x:evens)
where (odds, evens) = oddEven xs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment