let rec partition f = function
  | [] -> ([], [])
  | x::xs ->
    let (ys, zs) = partition f xs
    if f x then
      (x::ys, zs)
    else
      (ys, x::zs)

[1..8] |> partition (fun x -> x%2 = 1) |> printfn "%A"

Embed on website

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