alice
library
manual.

Alice Project

The Inspector structure


________ Synopsis ____________________________________________________

    signature INSPECTOR
    structure Inspector : INSPECTOR

The Inspector is an graphical tool that allows to interactively display and inspect data structures and modules.

For example, the expression

inspect x

tells the Inspector to show the value x. The Inspector will popup a window and pretty-print the value. Different elements are assigned different colors to make output more readable. Most stateful entitities are updated automatically in the display when their state changes.


________ Import ______________________________________________________

    import structure Inspector from "x-alice:/lib/tools/Inspector"

In the interactive toplevel the Inspector is available without further import announcements. The function inspect is available unqualified.


________ Interface ___________________________________________________

    signature INSPECTOR =
    sig
        val inspect : 'a -> unit
        functor Inspect (signature S structure X : S) : any

        val register : ('a -> string) -> unit
    end
  

________ Description _________________________________________________

inspect x

displays x in the Inspector window.

Inspect (signature S = S structure X = X)

displays the module X, having signature S.

register f

Adds function f as a layout function. The function must have a concrete type tyvarseq t -> string, where t has to be an abstract type. Further calls to inspect use this function to transform values of any type tyseq t into a tree the inspector can display. Raises Type if the type of f is not of the required form. This includes the case that t is not an abstract type, or that f is not fully polymorphic in the type arguments tyseq to t. Note that these rules also preclude f from being too polymorphic, i.e. being of type 'a -> string, because in that case no type name could be derived.



last modified 2007/Mar/30 17:10