[plt-scheme] Re: Re: Typed Scheme

From: Carl Eastlund (cce at ccs.neu.edu)
Date: Sun May 27 02:09:27 EDT 2007

On 5/27/07, Matthew Swank <akopa.gmane.poster at gmail.com> wrote:
> Now that I've thought about this a little more, I am curious as to how
> much type information languages like ML have to carry around at runtime.
> If you use type-casing in a function can the compiler statically resolve
> which case matches at each call site of the function?

ML doesn't use type-casing.  Its pattern matching is based on
constructors within a single known type.  As with many other program
properties, static analysis can detect whether a given case dispatch
(on patterns or anything else) may only use some branches, and if it's
a dispatch in a function call it may optimize by inlining only the
relevant branches.  But this is separate from typechecking, and would
apply equally well to Scheme or ML.

Carl Eastlund

Posted on the users mailing list.