Last active
June 26, 2025 15:58
-
-
Save chiroptical/bc2e85b9bd7bc2f18982d2a68855644b to your computer and use it in GitHub Desktop.
Quick impl of odd evens (probably not the most efficient version)
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
oddEven :: [Int] -> [Int] | |
oddEven inp = | |
let (x, y) = | |
foldr | |
( \v (odds, evens) -> | |
if v `mod` 2 == 0 | |
then (odds, (v : evens)) | |
else ((v : odds), evens) | |
) | |
([], []) | |
inp | |
in x <> y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment