In Scheme, I can write a function:
(define (eat-line line)
eat-line)
Which I could use in a loop like:
(define (loop op)
(let ((line (read-line))
(loop (op line))))
In OCaml I tried to define a function:
let rec eat_line line = eat_line
But I got the error:
Error: This expression has type 'a -> 'b
but an expression was expected of type 'b
The type variable 'b occurs inside 'a -> 'b
Is it possible to define such a function in OCaml, or is it prevented by the type system? If so, why?