src/Pure/ML-Systems/install_pp_polyml.ML
author wenzelm
Thu, 04 Dec 2008 23:01:11 +0100
changeset 28975 ec120dc11e8b
parent 28673 d746a8c12c43
child 29564 f8b933a62151
permissions -rw-r--r--
renamed type Lazy.T to lazy; renamed type Future.T to future;
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
    ID:         $Id$
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     3
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     4
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
     5
*)
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     6
28975
ec120dc11e8b renamed type Lazy.T to lazy;
wenzelm
parents: 28673
diff changeset
     7
install_pp (fn (str, _, _, _) => fn depth => fn (print: 'a * int -> unit) => fn (x: 'a future) =>
28557
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     8
  (case Future.peek x of
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
     9
    NONE => str "<future>"
28570
81d97311c057 tuned output;
wenzelm
parents: 28557
diff changeset
    10
  | SOME (Exn.Exn _) => str "<failed>"
28557
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
    11
  | SOME (Exn.Result y) => print (y, depth)));
6a661aeff564 extra Poly/ML toplevel pretty printing in ML-Systems/install_pp_polyml.ML;
wenzelm
parents:
diff changeset
    12
28975
ec120dc11e8b renamed type Lazy.T to lazy;
wenzelm
parents: 28673
diff changeset
    13
install_pp (fn (str, _, _, _) => fn depth => fn (print: 'a * int -> unit) => fn (x: 'a lazy) =>
28673
d746a8c12c43 renamed structure Susp to Lazy, and Susp.delay to Lazy.lazy;
wenzelm
parents: 28672
diff changeset
    14
  (case Lazy.peek x of
d746a8c12c43 renamed structure Susp to Lazy, and Susp.delay to Lazy.lazy;
wenzelm
parents: 28672
diff changeset
    15
    NONE => str "<lazy>"
28672
0baf1d9c6780 adapted Susp.peek;
wenzelm
parents: 28570
diff changeset
    16
  | SOME (Exn.Exn _) => str "<failed>"
0baf1d9c6780 adapted Susp.peek;
wenzelm
parents: 28570
diff changeset
    17
  | SOME (Exn.Result y) => print (y, depth)));
0baf1d9c6780 adapted Susp.peek;
wenzelm
parents: 28570
diff changeset
    18