If I execute the following in OCaml's toplevel:
#require "num";;
open Ratio;;
ratio_of_int 2;;
The output is:
- : Ratio.ratio = <ratio 2/1>
How's a formatting like this possible? The sources tell me that Ratio.ratio is a record. So the output should be more akin to
{numerator = <big_int 2>; denominator = <big_int 1>; normalized = true}
I tried see if ratio output is somehow hardcoded in toplevel, but this search was fruitless. Being new to OCaml, I must ask if I'm missing something important? In a language that has overloaded stringification funcs this wouldn't be strange, but in OCaml's case I find this behavior quite out of place.