master caster
Oct. 11th, 2004 02:02 amFrom Pierce's Types and Programming Languages:
"There are three rules for type casts: in an upcast the subject is a subclass of the target, in a downcast the target is a subclass of the subject, and in a stupid cast the target is unrelated to the subject."
"There are three rules for type casts: in an upcast the subject is a subclass of the target, in a downcast the target is a subclass of the subject, and in a stupid cast the target is unrelated to the subject."
Re: special guest replier!
Date: 2004-10-11 10:12 am (UTC)casepart of the signature, but it's clearly the sensible move. Maybe a record type instead of a curried list, since ordering is a bit arbitrary -- so, in SML syntax:datatype foo = bar of X | baz of Yval case: { bar: X -> 'a, baz: Y -> 'a } -> foo -> 'a