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/no6o6a/prog.fs(1,32): error FS0039: The value or constructor 'f' is not defined

/home/no6o6a/prog.fs(13,14): error FS0001: Expecting a type supporting the operator '***' but given a function type. You may be missing an argument to a function.

/home/no6o6a/prog.fs(3,19): error FS0043: Expecting a type supporting the operator '***' but given a function type. You may be missing an argument to a function.

/home/no6o6a/prog.fs(15,15): error FS0039: The value or constructor 'splitAt' is not defined

/home/no6o6a/prog.fs(3,19): error FS0043: Expecting a type supporting the operator '***' but given a function type. You may be missing an argument to a function.
stdout
Standard output is empty