Hello everybody!
I have test.ml
with the following code (not sealed to any interface):
let char () = Char.chr 65
let uchar () = Uchar.of_char @@ char ()
For this module utop shows type a
instead of Uchar.t
:
# #show_module Test;;
module Test_unsealed : sig
val char : unit -> char
val uchar : unit -> a
end
And yet I can see type with #typeof
directive and use output of uchar ()
as input to Uchar
's functions:
# #typeof "Test.uchar";;
val ( Test.uchar ) : unit -> Uchar.t
# Test.uchar ();;
- : a = <abstr>
# Uchar.to_int @@ Test.uchar ();;
- : int = 65
Could anybody please explain me why this happens and how to solve it if possible?