src/Pure/ML-Systems/install_pp_polyml-experimental.ML
author wenzelm
Tue, 24 Mar 2009 23:43:58 +0100
changeset 30714 88bc86d7dec3
parent 30633 cc18ae3c1c7f
child 31311 b82e55f51dcc
permissions -rw-r--r--
simplified addPrettyPrinter setup: may pass (fn ...) directly if type constraints are omitted -- addPrettyPrinter treated as a special case internally;

(*  Title:      Pure/ML-Systems/install_pp_polyml-experimental.ML

Extra toplevel pretty-printing for Poly/ML; experimental version for
Poly/ML 5.3.
*)

addPrettyPrinter (fn depth => fn pretty => fn x =>
  (case Future.peek x of
    NONE => PrettyString "<future>"
  | SOME (Exn.Exn _) => PrettyString "<failed>"
  | SOME (Exn.Result y) => pretty (y, depth)));

addPrettyPrinter (fn depth => fn pretty => fn x =>
  (case Lazy.peek x of
    NONE => PrettyString "<lazy>"
  | SOME (Exn.Exn _) => PrettyString "<failed>"
  | SOME (Exn.Result y) => pretty (y, depth)));