fork download
  1. let f *** g = fun (a, b) -> (f a, g b)
  2.  
  3. let biApply f = f *** f
  4.  
  5. let splitAt n list =
  6. let splitter ((xs, ys), n') c =
  7. if n' < n then
  8. ((c :: xs, ys), n' + 1)
  9. else
  10. ((xs, c :: ys), n' + 1)
  11. List.fold splitter (([], []), 0) list
  12. |> fst
  13. |> biApply List.rev
  14.  
  15. printfn "%A" (splitAt 3 [2; 90; 1; 22])
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/home/tzkINm/prog.fs(1,7): error FS0010: Unexpected infix operator in pattern
stdout
Standard output is empty