let foo = function | `One as x -> x | `Two as x -> x
val foo : [< `One | `Two ] -> [> `One | `Two ] = <fun>
let foo : [< `One ] -> [> `One ] = function | `One as x -> x | `Two as x -> x
let foo : [< `One ] -> [> `One ] = function | `One as x -> x;; | `Two as x -> x --- Warning 11: this match case is unused. val foo : [< `One ] -> [> `One | `Two ] = <fun>
let foo : ([< `One ] -> [> `One ]) & ([< `One | `Two ] -> [> `One | `Two ]) = function | `One as x -> x | `Two as x -> x
foo : (type a < [`One | `Two ]) 'a -> 'a
foo : ('a & [`One | `Two ]) -> ('a & [`One | `Two ])
Optional: According to the advancement state of the project, the intern will also explore using intersection types to generalize or complete polymorphism of record types based on row variables. Thus the project will study the best way to integrate the two kinds of polymorphism
|
|