[m-rev.] for review: Remove io.poly_type

Paul Bone paul at bone.id.au
Thu Aug 25 12:33:32 AEST 2016


For review.  Julien suggested making this change and I agree.  The reviewer
only needs to check the NEWS entry.

---

Remove io.poly_type

Remove io.poly_type in favor of string.poly_type.

library/io.m:
    As above.

compiler/parse_tree_out_info.m:
    Conform to above change.

NEWS:
    Annouce change.
---
 NEWS                           |  3 +++
 compiler/parse_tree_out_info.m |  6 +++---
 library/io.m                   | 13 ++++---------
 3 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/NEWS b/NEWS
index d160bba..ec77eea 100644
--- a/NEWS
+++ b/NEWS
@@ -155,6 +155,9 @@ Changes to the Mercury standard library:
   io.have_set_environment_var/0 that tests for the ability to set
   environment variables on the current platform.
 
+* We have removed the io.poly_type equivalence type from the io module.
+  string.poly_type should be used directly.
+
 * We have added a module for discrete interval encoding trees, which are a
   highly efficient set implementation for fat sets.  This module is a
   contribution from Yes Logic Pty. Ltd.
diff --git a/compiler/parse_tree_out_info.m b/compiler/parse_tree_out_info.m
index 1395c9d..e61532b 100644
--- a/compiler/parse_tree_out_info.m
+++ b/compiler/parse_tree_out_info.m
@@ -62,6 +62,7 @@
 :- import_module char.
 :- import_module io.
 :- import_module list.
+:- import_module string.
 :- import_module term.
 
 %---------------------------------------------------------------------------%
@@ -113,7 +114,7 @@
     pred add_eval_method(eval_method::in, U::di, U::uo) is det,
     pred add_lambda_eval_method(lambda_eval_method::in, U::di, U::uo) is det,
     pred add_escaped_string(string::in, U::di, U::uo) is det,
-    pred add_format(string::in, list(io.poly_type)::in, U::di, U::uo) is det,
+    pred add_format(string::in, list(poly_type)::in, U::di, U::uo) is det,
     pred add_list(list(T)::in, string::in,
         pred(T, U, U)::in(pred(in, di, uo) is det), U::di, U::uo) is det
 ].
@@ -130,7 +131,6 @@
 :- import_module parse_tree.prog_out.
 
 :- import_module bool.
-:- import_module string.
 :- import_module term_io.
 
 %---------------------------------------------------------------------------%
@@ -307,7 +307,7 @@ output_eval_eval_method(EvalMethod, !Str) :-
 output_lambda_eval_method(lambda_normal, !Str) :-
     output_string("normal", !Str).
 
-:- pred output_format(string::in, list(io.poly_type)::in,
+:- pred output_format(string::in, list(poly_type)::in,
     string::di, string::uo) is det.
 
 output_format(Format, Items, Str0, Str) :-
diff --git a/library/io.m b/library/io.m
index b3c765f..369cd25 100644
--- a/library/io.m
+++ b/library/io.m
@@ -114,11 +114,6 @@
 
 :- type io.error.   % Use error_message to decode it.
 
-    % Poly-type is used for write_many and format,
-    % which do printf-like formatting.
-    %
-:- type io.poly_type == string.poly_type.
-
     % whence denotes the base for a seek operation.
     %   set - seek relative to the start of the file
     %   cur - seek relative to the current position in the file
@@ -541,22 +536,22 @@
     % using string.format, and then writes the result to the current
     % output stream. (See the documentation of string.format for details.)
     %
-:- pred format(string::in, list(io.poly_type)::in, io::di, io::uo) is det.
+:- pred format(string::in, list(poly_type)::in, io::di, io::uo) is det.
 
     % Formats the specified argument list according to the format string,
     % using string.format, and then writes the result to the specified
     % output stream. (See the documentation of string.format for details.)
     %
-:- pred format(text_output_stream::in, string::in, list(io.poly_type)::in,
+:- pred format(text_output_stream::in, string::in, list(poly_type)::in,
     io::di, io::uo) is det.
 
     % Writes the specified arguments to the current output stream.
     %
-:- pred write_many(list(io.poly_type)::in, io::di, io::uo) is det.
+:- pred write_many(list(poly_type)::in, io::di, io::uo) is det.
 
     % Writes the specified arguments to the specified output stream.
     %
-:- pred write_many(text_output_stream::in, list(io.poly_type)::in,
+:- pred write_many(text_output_stream::in, list(poly_type)::in,
     io::di, io::uo) is det.
 
     % write_list(List, Separator, OutputPred, !IO):
-- 
2.7.4



More information about the reviews mailing list