simplified signature (again, see 751bcf0473a7): e.g. relevant for non-Isabelle ML environments;
authorwenzelm
Thu Sep 06 14:08:35 2018 +0200 (10 months ago)
changeset 689183a0db30e5d87
parent 68917 75691a5c8fb6
child 68920 e50312982ba0
simplified signature (again, see 751bcf0473a7): e.g. relevant for non-Isabelle ML environments;
src/Pure/Concurrent/future.ML
src/Pure/Concurrent/lazy.ML
src/Pure/General/pretty.ML
src/Pure/ML/ml_init.ML
src/Pure/ML/ml_pretty.ML
src/Pure/ML_Bootstrap.thy
     1.1 --- a/src/Pure/Concurrent/future.ML	Thu Sep 06 13:54:07 2018 +0200
     1.2 +++ b/src/Pure/Concurrent/future.ML	Thu Sep 06 14:08:35 2018 +0200
     1.3 @@ -112,8 +112,8 @@
     1.4  val _ =
     1.5    ML_system_pp (fn depth => fn pretty => fn x =>
     1.6      (case peek x of
     1.7 -      NONE => PolyML_Pretty.PrettyString "<future>"
     1.8 -    | SOME (Exn.Exn _) => PolyML_Pretty.PrettyString "<failed>"
     1.9 +      NONE => PolyML.PrettyString "<future>"
    1.10 +    | SOME (Exn.Exn _) => PolyML.PrettyString "<failed>"
    1.11      | SOME (Exn.Res y) => pretty (y, depth)));
    1.12  
    1.13  
     2.1 --- a/src/Pure/Concurrent/lazy.ML	Thu Sep 06 13:54:07 2018 +0200
     2.2 +++ b/src/Pure/Concurrent/lazy.ML	Thu Sep 06 14:08:35 2018 +0200
     2.3 @@ -157,8 +157,8 @@
     2.4  val _ =
     2.5    ML_system_pp (fn depth => fn pretty => fn x =>
     2.6      (case peek x of
     2.7 -      NONE => PolyML_Pretty.PrettyString "<lazy>"
     2.8 -    | SOME (Exn.Exn _) => PolyML_Pretty.PrettyString "<failed>"
     2.9 +      NONE => PolyML.PrettyString "<lazy>"
    2.10 +    | SOME (Exn.Exn _) => PolyML.PrettyString "<failed>"
    2.11      | SOME (Exn.Res y) => pretty (y, depth)));
    2.12  
    2.13  end;
     3.1 --- a/src/Pure/General/pretty.ML	Thu Sep 06 13:54:07 2018 +0200
     3.2 +++ b/src/Pure/General/pretty.ML	Thu Sep 06 14:08:35 2018 +0200
     3.3 @@ -76,8 +76,8 @@
     3.4    val writeln_chunks2: T list -> unit
     3.5    val to_ML: FixedInt.int -> T -> ML_Pretty.pretty
     3.6    val from_ML: ML_Pretty.pretty -> T
     3.7 -  val to_polyml: T -> PolyML_Pretty.pretty
     3.8 -  val from_polyml: PolyML_Pretty.pretty -> T
     3.9 +  val to_polyml: T -> PolyML.pretty
    3.10 +  val from_polyml: PolyML.pretty -> T
    3.11  end;
    3.12  
    3.13  structure Pretty: PRETTY =
     4.1 --- a/src/Pure/ML/ml_init.ML	Thu Sep 06 13:54:07 2018 +0200
     4.2 +++ b/src/Pure/ML/ml_init.ML	Thu Sep 06 14:08:35 2018 +0200
     4.3 @@ -4,12 +4,6 @@
     4.4  Initial ML environment.
     4.5  *)
     4.6  
     4.7 -structure PolyML_Pretty =
     4.8 -struct
     4.9 -  datatype context = datatype PolyML.context;
    4.10 -  datatype pretty = datatype PolyML.pretty;
    4.11 -end;
    4.12 -
    4.13  val seconds = Time.fromReal;
    4.14  
    4.15  val _ =
     5.1 --- a/src/Pure/ML/ml_pretty.ML	Thu Sep 06 13:54:07 2018 +0200
     5.2 +++ b/src/Pure/ML/ml_pretty.ML	Thu Sep 06 14:08:35 2018 +0200
     5.3 @@ -17,12 +17,12 @@
     5.4      ('a * 'b) * FixedInt.int -> pretty
     5.5    val enum: string -> string -> string -> ('a * FixedInt.int -> pretty) ->
     5.6      'a list * FixedInt.int -> pretty
     5.7 -  val to_polyml: pretty -> PolyML_Pretty.pretty
     5.8 -  val from_polyml: PolyML_Pretty.pretty -> pretty
     5.9 -  val format_polyml: int -> PolyML_Pretty.pretty -> string
    5.10 +  val to_polyml: pretty -> PolyML.pretty
    5.11 +  val from_polyml: PolyML.pretty -> pretty
    5.12 +  val format_polyml: int -> PolyML.pretty -> string
    5.13    val format: int -> pretty -> string
    5.14    val default_margin: int
    5.15 -  val string_of_polyml: PolyML_Pretty.pretty -> string
    5.16 +  val string_of_polyml: PolyML.pretty -> string
    5.17    val make_string_fn: string
    5.18  end;
    5.19  
    5.20 @@ -54,39 +54,39 @@
    5.21  
    5.22  (* convert *)
    5.23  
    5.24 -fun to_polyml (Break (false, width, offset)) = PolyML_Pretty.PrettyBreak (width, offset)
    5.25 +fun to_polyml (Break (false, width, offset)) = PolyML.PrettyBreak (width, offset)
    5.26    | to_polyml (Break (true, _, _)) =
    5.27 -      PolyML_Pretty.PrettyBlock (0, false, [PolyML_Pretty.ContextProperty ("fbrk", "")],
    5.28 -        [PolyML_Pretty.PrettyString " "])
    5.29 +      PolyML.PrettyBlock (0, false, [PolyML.ContextProperty ("fbrk", "")],
    5.30 +        [PolyML.PrettyString " "])
    5.31    | to_polyml (Block ((bg, en), consistent, ind, prts)) =
    5.32        let val context =
    5.33 -        (if bg = "" then [] else [PolyML_Pretty.ContextProperty ("begin", bg)]) @
    5.34 -        (if en = "" then [] else [PolyML_Pretty.ContextProperty ("end", en)])
    5.35 -      in PolyML_Pretty.PrettyBlock (ind, consistent, context, map to_polyml prts) end
    5.36 +        (if bg = "" then [] else [PolyML.ContextProperty ("begin", bg)]) @
    5.37 +        (if en = "" then [] else [PolyML.ContextProperty ("end", en)])
    5.38 +      in PolyML.PrettyBlock (ind, consistent, context, map to_polyml prts) end
    5.39    | to_polyml (String (s, len)) =
    5.40 -      if len = FixedInt.fromInt (size s) then PolyML_Pretty.PrettyString s
    5.41 +      if len = FixedInt.fromInt (size s) then PolyML.PrettyString s
    5.42        else
    5.43 -        PolyML_Pretty.PrettyBlock
    5.44 +        PolyML.PrettyBlock
    5.45            (0, false,
    5.46 -            [PolyML_Pretty.ContextProperty ("length", FixedInt.toString len)], [PolyML_Pretty.PrettyString s]);
    5.47 +            [PolyML.ContextProperty ("length", FixedInt.toString len)], [PolyML.PrettyString s]);
    5.48  
    5.49  val from_polyml =
    5.50    let
    5.51 -    fun convert _ (PolyML_Pretty.PrettyBreak (width, offset)) = Break (false, width, offset)
    5.52 -      | convert _ (PolyML_Pretty.PrettyBlock (_, _,
    5.53 -            [PolyML_Pretty.ContextProperty ("fbrk", _)], [PolyML_Pretty.PrettyString " "])) =
    5.54 +    fun convert _ (PolyML.PrettyBreak (width, offset)) = Break (false, width, offset)
    5.55 +      | convert _ (PolyML.PrettyBlock (_, _,
    5.56 +            [PolyML.ContextProperty ("fbrk", _)], [PolyML.PrettyString " "])) =
    5.57            Break (true, 1, 0)
    5.58 -      | convert len (PolyML_Pretty.PrettyBlock (ind, consistent, context, prts)) =
    5.59 +      | convert len (PolyML.PrettyBlock (ind, consistent, context, prts)) =
    5.60            let
    5.61              fun property name default =
    5.62 -              (case List.find (fn PolyML_Pretty.ContextProperty (a, _) => name = a | _ => false) context of
    5.63 -                SOME (PolyML_Pretty.ContextProperty (_, b)) => b
    5.64 +              (case List.find (fn PolyML.ContextProperty (a, _) => name = a | _ => false) context of
    5.65 +                SOME (PolyML.ContextProperty (_, b)) => b
    5.66                | _ => default);
    5.67              val bg = property "begin" "";
    5.68              val en = property "end" "";
    5.69              val len' = property "length" len;
    5.70            in Block ((bg, en), consistent, ind, map (convert len') prts) end
    5.71 -      | convert len (PolyML_Pretty.PrettyString s) =
    5.72 +      | convert len (PolyML.PrettyString s) =
    5.73            String (s, FixedInt.fromInt (case Int.fromString len of SOME i => i | NONE => size s))
    5.74    in convert "" end;
    5.75  
     6.1 --- a/src/Pure/ML_Bootstrap.thy	Thu Sep 06 13:54:07 2018 +0200
     6.2 +++ b/src/Pure/ML_Bootstrap.thy	Thu Sep 06 14:08:35 2018 +0200
     6.3 @@ -18,7 +18,7 @@
     6.4    structure Output_Primitives = Output_Primitives_Virtual;
     6.5    structure Thread_Data = Thread_Data_Virtual;
     6.6    structure PolyML = PolyML;
     6.7 -  fun ML_system_pp (_: FixedInt.int -> 'a -> 'b -> PolyML_Pretty.pretty) = ();
     6.8 +  fun ML_system_pp (_: FixedInt.int -> 'a -> 'b -> PolyML.pretty) = ();
     6.9  
    6.10    Proofterm.proofs := 0;
    6.11  
    6.12 @@ -29,6 +29,8 @@
    6.13        struct
    6.14          val pointerEq = pointer_eq;
    6.15          structure IntInf = PolyML.IntInf;
    6.16 +        datatype context = datatype PolyML.context;
    6.17 +        datatype pretty = datatype PolyML.pretty;
    6.18        end;
    6.19      \<close>
    6.20  \<close>