src/Pure/ML-Systems/install_pp_polyml.ML
author wenzelm
Sun, 31 May 2009 15:07:03 +0200
changeset 31314 b58d6a33b57f
parent 29564 f8b933a62151
permissions -rw-r--r--
explicit PolyML.install_pp;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28557
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     1
(*  Title:      Pure/ML-Systems/install_pp_polyml.ML
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     2
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     3
Extra toplevel pretty-printing for Poly/ML.
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     4
*)
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     5
31314
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
     6
PolyML.install_pp
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
     7
  (fn (str, _, _, _) => fn depth => fn (print: 'a * int -> unit) => fn (x: 'a future) =>
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
     8
    (case Future.peek x of
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
     9
      NONE => str "<future>"
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
    10
    | SOME (Exn.Exn _) => str "<failed>"
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
    11
    | SOME (Exn.Result y) => print (y, depth)));
28557
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
    12
31314
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
    13
PolyML.install_pp
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
    14
  (fn (str, _, _, _) => fn depth => fn (print: 'a * int -> unit) => fn (x: 'a lazy) =>
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
    15
    (case Lazy.peek x of
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
    16
      NONE => str "<lazy>"
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
    17
    | SOME (Exn.Exn _) => str "<failed>"
b58d6a33b57f explicit PolyML.install_pp;
wenzelm
parents: 29564
diff changeset
    18
    | SOME (Exn.Result y) => print (y, depth)));
28672
0baf1d9c6780 adapted Susp.peek;
wenzelm
parents: 28570
diff changeset
    19