getEven/getOdd

assos 2018-03-07 16:14:53.504066 UTC

1getEven :: [a] -> [a]
2getEven [] = []
3getEven [_] = []
4getEven (_:y:xs) = y : getEven xs
5
6getOdd :: [a] -> [a]
7getOdd [] = []
8getOdd [x] = [x]
9getOdd (x:_:xs) = x : getOdd xs