Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yes, printf is easy in F#. The following example works in F# and OCaml:

  let rec fact n =
     Printf.printf "%i\n" n;
     if n = 0 then 1 else n * (fact (n-1))


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: