Execute the term in ML, and return the textual response, indicating the type and value, or an error message, in a cover.
For example, you can easily find the type of an identifier this way; using this command on the identifier quicksort gives,
NOTICE: - : ((* -> * -> bool) -> * list -> * list) quicksort
If the ML name cache is active, which is the default (
NOTICE: *+inta int
* list
b int* list list
x bool if x then (inl (last (hd a.b) 1)) else inr 0
The cover (NOTICE: <term> <term>) is easily removed with
DEFICIENCY: | The utility misbehaves when evaluating a subterm that happens to contain cached ML identifiers that are bound above the point. A version of this function that would scan up for the context was too slow, so this inferior functionality was adopted. When you have no interest in the global binding of some identifier that you're using locally, it is sometimes worthwhile to remove the identifier from the cache with the aptly named button in the ML edit menu |