tuned signature;
authorwenzelm
Sat Apr 02 22:38:26 2016 +0200 (2016-04-02 ago)
changeset 62823751bcf0473a7
parent 62822 941b6a48ff67
child 62824 3498c66b5e55
tuned signature;
src/Pure/Concurrent/future.ML
src/Pure/Concurrent/lazy.ML
src/Pure/General/pretty.ML
src/Pure/ML/ml_pervasive.ML
src/Pure/ML/ml_pretty.ML
     1.1 --- a/src/Pure/Concurrent/future.ML	Sat Apr 02 22:13:00 2016 +0200
     1.2 +++ b/src/Pure/Concurrent/future.ML	Sat Apr 02 22:38:26 2016 +0200
     1.3 @@ -102,8 +102,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.PrettyString "<future>"
     1.8 -    | SOME (Exn.Exn _) => PolyML.PrettyString "<failed>"
     1.9 +      NONE => PolyML_Pretty.PrettyString "<future>"
    1.10 +    | SOME (Exn.Exn _) => PolyML_Pretty.PrettyString "<failed>"
    1.11      | SOME (Exn.Res y) => pretty (y, depth)));
    1.12  
    1.13  
     2.1 --- a/src/Pure/Concurrent/lazy.ML	Sat Apr 02 22:13:00 2016 +0200
     2.2 +++ b/src/Pure/Concurrent/lazy.ML	Sat Apr 02 22:38:26 2016 +0200
     2.3 @@ -105,8 +105,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.PrettyString "<lazy>"
     2.8 -    | SOME (Exn.Exn _) => PolyML.PrettyString "<failed>"
     2.9 +      NONE => PolyML_Pretty.PrettyString "<lazy>"
    2.10 +    | SOME (Exn.Exn _) => PolyML_Pretty.PrettyString "<failed>"
    2.11      | SOME (Exn.Res y) => pretty (y, depth)));
    2.12  
    2.13  end;
     3.1 --- a/src/Pure/General/pretty.ML	Sat Apr 02 22:13:00 2016 +0200
     3.2 +++ b/src/Pure/General/pretty.ML	Sat Apr 02 22:38:26 2016 +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
     3.8 -  val from_polyml: PolyML.pretty -> T
     3.9 +  val to_polyml: T -> PolyML_Pretty.pretty
    3.10 +  val from_polyml: PolyML_Pretty.pretty -> T
    3.11  end;
    3.12  
    3.13  structure Pretty: PRETTY =
     4.1 --- a/src/Pure/ML/ml_pervasive.ML	Sat Apr 02 22:13:00 2016 +0200
     4.2 +++ b/src/Pure/ML/ml_pervasive.ML	Sat Apr 02 22:38:26 2016 +0200
     4.3 @@ -4,6 +4,12 @@
     4.4  Pervasive 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	Sat Apr 02 22:13:00 2016 +0200
     5.2 +++ b/src/Pure/ML/ml_pretty.ML	Sat Apr 02 22:38:26 2016 +0200
     5.3 @@ -17,11 +17,11 @@
     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
     5.8 -  val from_polyml: PolyML.pretty -> pretty
     5.9 +  val to_polyml: pretty -> PolyML_Pretty.pretty
    5.10 +  val from_polyml: PolyML_Pretty.pretty -> pretty
    5.11    val get_print_depth: unit -> int
    5.12    val print_depth: int -> unit
    5.13 -  val format_polyml: int -> PolyML.pretty -> string
    5.14 +  val format_polyml: int -> PolyML_Pretty.pretty -> string
    5.15    val format: int -> pretty -> string
    5.16    val make_string_fn: string -> string
    5.17  end;
    5.18 @@ -54,39 +54,39 @@
    5.19  
    5.20  (* convert *)
    5.21  
    5.22 -fun to_polyml (Break (false, width, offset)) = PolyML.PrettyBreak (width, offset)
    5.23 +fun to_polyml (Break (false, width, offset)) = PolyML_Pretty.PrettyBreak (width, offset)
    5.24    | to_polyml (Break (true, _, _)) =
    5.25 -      PolyML.PrettyBlock (0, false, [PolyML.ContextProperty ("fbrk", "")],
    5.26 -        [PolyML.PrettyString " "])
    5.27 +      PolyML_Pretty.PrettyBlock (0, false, [PolyML_Pretty.ContextProperty ("fbrk", "")],
    5.28 +        [PolyML_Pretty.PrettyString " "])
    5.29    | to_polyml (Block ((bg, en), consistent, ind, prts)) =
    5.30        let val context =
    5.31 -        (if bg = "" then [] else [PolyML.ContextProperty ("begin", bg)]) @
    5.32 -        (if en = "" then [] else [PolyML.ContextProperty ("end", en)])
    5.33 -      in PolyML.PrettyBlock (ind, consistent, context, map to_polyml prts) end
    5.34 +        (if bg = "" then [] else [PolyML_Pretty.ContextProperty ("begin", bg)]) @
    5.35 +        (if en = "" then [] else [PolyML_Pretty.ContextProperty ("end", en)])
    5.36 +      in PolyML_Pretty.PrettyBlock (ind, consistent, context, map to_polyml prts) end
    5.37    | to_polyml (String (s, len)) =
    5.38 -      if len = FixedInt.fromInt (size s) then PolyML.PrettyString s
    5.39 +      if len = FixedInt.fromInt (size s) then PolyML_Pretty.PrettyString s
    5.40        else
    5.41 -        PolyML.PrettyBlock
    5.42 +        PolyML_Pretty.PrettyBlock
    5.43            (0, false,
    5.44 -            [PolyML.ContextProperty ("length", FixedInt.toString len)], [PolyML.PrettyString s]);
    5.45 +            [PolyML_Pretty.ContextProperty ("length", FixedInt.toString len)], [PolyML_Pretty.PrettyString s]);
    5.46  
    5.47  val from_polyml =
    5.48    let
    5.49 -    fun convert _ (PolyML.PrettyBreak (width, offset)) = Break (false, width, offset)
    5.50 -      | convert _ (PolyML.PrettyBlock (_, _,
    5.51 -            [PolyML.ContextProperty ("fbrk", _)], [PolyML.PrettyString " "])) =
    5.52 +    fun convert _ (PolyML_Pretty.PrettyBreak (width, offset)) = Break (false, width, offset)
    5.53 +      | convert _ (PolyML_Pretty.PrettyBlock (_, _,
    5.54 +            [PolyML_Pretty.ContextProperty ("fbrk", _)], [PolyML_Pretty.PrettyString " "])) =
    5.55            Break (true, 1, 0)
    5.56 -      | convert len (PolyML.PrettyBlock (ind, consistent, context, prts)) =
    5.57 +      | convert len (PolyML_Pretty.PrettyBlock (ind, consistent, context, prts)) =
    5.58            let
    5.59              fun property name default =
    5.60 -              (case List.find (fn PolyML.ContextProperty (a, _) => name = a | _ => false) context of
    5.61 -                SOME (PolyML.ContextProperty (_, b)) => b
    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                | _ => default);
    5.65              val bg = property "begin" "";
    5.66              val en = property "end" "";
    5.67              val len' = property "length" len;
    5.68            in Block ((bg, en), consistent, ind, map (convert len') prts) end
    5.69 -      | convert len (PolyML.PrettyString s) =
    5.70 +      | convert len (PolyML_Pretty.PrettyString s) =
    5.71            String (s, FixedInt.fromInt (case Int.fromString len of SOME i => i | NONE => size s))
    5.72    in convert "" end;
    5.73