[TYPES] union types and overloading

Kwangkeun Yi kwang at ropas.snu.ac.kr
Fri Oct 1 15:44:34 EDT 2004


Hi there,

I would like to extend our ML compiler's type system so that it allow
functions to be defined over the sum of multiple datatypes. (union types?)

E.g., 

type t1 = A of int | B of t1
type t2 = C | D of t2

(* accept-both : t1+t2 -> int *)
fun accept-both (A n) = n
  | accept-both (B x) = 0
  | accept-both C = 0
  | accept-both (D y) = 0

Could you point me to some papers that I have to check out to avoid
reinvention or to expect possible obstacles? 

Thank you, 

-Kwang

--
Kwangkeun Yi		http://ropas.snu.ac.kr/~kwang



More information about the Types-list mailing list