fork download
  1. let fac n =
  2. let rec accumulator product i =
  3. if i < 1 then product
  4. else if i > 0 then (accumulator (product*i) (i-1))
  5. in accumulator 1 n;;
  6.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
File "prog.ml", line 4, characters 24-55:
Error: This expression has type int but an expression was expected of type
         unit
stdout
Standard output is empty