Skalpel: A Type Error Slicer for SML

The Standard ML language has a sophisticated type system, and unfortunately type error messages produced by previously available tools (such as most of the SML implementations e.g. SML/NJ) are confusing and misleading and cost significant programmer time to correct. These messages are confusing because they often:

  1. Identify error locations that might be far from the real programming error,
  2. Exhibit purported parts of the program which are actually significantly transformed from the real source code, and
  3. Exhibit types which the programmer does not recognise because they mention internal unification variables or do not match the programmer's intention.

Our type error slicer, Skalpel, reports error messages that have none of the above issues. Instead, Skalpel:

  1. Identifies all of the program points that contribute to a type error (including the spot with the actual programming error that caused the type error),
  2. Highlights these program points in the original, unchanged source code, and
  3. Avoids showing internal details of the operation of the type inference machinery.

Note: If you would like to try Skalpel before you download it, you can experiment with the latest version by clicking here. If you do like it (or don't!), then please let us know by using our mailing list.

Below are the error messages output from both Skalpel using the Emacs interface (using Emacs v22.3.1) and SML/NJ (v110.70) when run on a small ill-typed SML program.

Skalpel highlights all the locations involved in the reported type error. Any of the pieces of code at these locations can be changed to solve this particular type error. If we assume that the programming error is that weight x was supposed to be weight * x, note that the region reported by SML/NJ (v110.70) does not include the location of the programming error, which can be very misleading.

The menu on the left will help you navigate through our website.


Web page validation
Valid XHTML 1.0 Transitional Valid CSS!