chickadee » datatype » cases

(cases TYPENAME EXP CLAUSE ...)syntax

A facility for matching and deconstructing the instance EXP of the variant record with the name TYPENAME. Each CLAUSE specifies a constructor with field-names and a body to execute when the constructor matches the record instance:

 CLAUSE = (CONSTRUCTOR (FIELDNAME ...) BODY ...)
        | (else BODY ...)