src/Pure/ML/install_pp_polyml.ML
author wenzelm
Sun, 20 May 2012 11:34:33 +0200
changeset 47884 21c42b095c84
parent 43761 e72ba84ae58f
child 47986 ca7104aebb74
permissions -rw-r--r--
try to avoid races again (cf. 8c37cb84065f and fd3a36e48b09);

(*  Title:      Pure/ML/install_pp_polyml.ML
    Author:     Makarius

Extra toplevel pretty-printing for Poly/ML.
*)

PolyML.install_pp
  (fn (str, _, _, _) => fn depth => fn (print: 'a * int -> unit) => fn (x: 'a future) =>
    (case Future.peek x of
      NONE => str "<future>"
    | SOME (Exn.Exn _) => str "<failed>"
    | SOME (Exn.Res y) => print (y, depth)));

PolyML.install_pp
  (fn (str, _, _, _) => fn depth => fn (print: 'a * int -> unit) => fn (x: 'a lazy) =>
    (case Lazy.peek x of
      NONE => str "<lazy>"
    | SOME (Exn.Exn _) => str "<failed>"
    | SOME (Exn.Res y) => print (y, depth)));