I'm trying to make a function that uses a subtype of a defined type but OCaml wont derive the correct value : Consider this type definition:
type fraction = {numerator : int; denominator : int};;
type number =
| Int of int
| Fraction of fraction;;
if i try to type into the interpeter (i'm using utop if it matters) :
utop # ((fun a-> a>0) (Int 1));;
Error: This expression has type number but an expression was expected of type int
type number is also an int but I cant get the function to understand that, how can I solve this?