partition _ [] = ([], [])
partition f (x:xs) =
  let (ys, zs) = partition f xs
  in if f x 
     then (x:ys, zs)
     else (ys, x:zs)
  
main = do
  let li = [0,1,2,3,4,5]
  print $ partition odd li

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: