src/Pure/ML-Systems/install_pp_polyml.ML
author haftmann
Tue Oct 20 16:13:01 2009 +0200 (2009-10-20)
changeset 33037 b22e44496dc2
parent 31314 b58d6a33b57f
permissions -rw-r--r--
replaced old_style infixes eq_set, subset, union, inter and variants by generic versions
     1 (*  Title:      Pure/ML-Systems/install_pp_polyml.ML
     2 
     3 Extra toplevel pretty-printing for Poly/ML.
     4 *)
     5 
     6 PolyML.install_pp
     7   (fn (str, _, _, _) => fn depth => fn (print: 'a * int -> unit) => fn (x: 'a future) =>
     8     (case Future.peek x of
     9       NONE => str "<future>"
    10     | SOME (Exn.Exn _) => str "<failed>"
    11     | SOME (Exn.Result y) => print (y, depth)));
    12 
    13 PolyML.install_pp
    14   (fn (str, _, _, _) => fn depth => fn (print: 'a * int -> unit) => fn (x: 'a lazy) =>
    15     (case Lazy.peek x of
    16       NONE => str "<lazy>"
    17     | SOME (Exn.Exn _) => str "<failed>"
    18     | SOME (Exn.Result y) => print (y, depth)));
    19