[m-rev.] diff: clean up pprint.m a bit

Zoltan Somogyi zs at cs.mu.OZ.AU
Tue Jul 16 18:09:55 AEST 2002


library/pprint.m:
	Clean up this file a bit, to make future merges with the
	mode-constraints branch easier.

	Add special casing for variables and sparse bitsets, since these can be
	useful.

	Group predicates and functions logically.

	Put the casting predicates and the *_to_doc functions for the special
	cases in the same order as the special case tests in to_doc itself.

	Shorten excessively long dividing lines.

tests/hard_coded/pprint_test.{m,exp}:
	A new test case to test the new additions to to_doc.

tests/hard_coded/Mmakefile:
	Enable the new test case.

Zoltan.

cvs diff: Diffing .
cvs diff: Diffing bench
cvs diff: Diffing bench/progs
cvs diff: Diffing bench/progs/compress
cvs diff: Diffing bench/progs/icfp2000
cvs diff: Diffing bench/progs/icfp2001
cvs diff: Diffing bench/progs/nuc
cvs diff: Diffing bench/progs/ray
cvs diff: Diffing bench/progs/tree234
cvs diff: Diffing bindist
cvs diff: Diffing boehm_gc
cvs diff: Diffing boehm_gc/Mac_files
cvs diff: Diffing boehm_gc/cord
cvs diff: Diffing boehm_gc/cord/private
cvs diff: Diffing boehm_gc/doc
cvs diff: Diffing boehm_gc/include
cvs diff: Diffing boehm_gc/include/private
cvs diff: Diffing boehm_gc/tests
cvs diff: Diffing browser
cvs diff: Diffing bytecode
cvs diff: Diffing compiler
cvs diff: Diffing compiler/notes
cvs diff: Diffing debian
cvs diff: Diffing deep_profiler
cvs diff: Diffing deep_profiler/notes
cvs diff: Diffing doc
cvs diff: Diffing extras
cvs diff: Diffing extras/aditi
cvs diff: Diffing extras/cgi
cvs diff: Diffing extras/complex_numbers
cvs diff: Diffing extras/complex_numbers/samples
cvs diff: Diffing extras/complex_numbers/tests
cvs diff: Diffing extras/concurrency
cvs diff: Diffing extras/curs
cvs diff: Diffing extras/curs/samples
cvs diff: Diffing extras/curses
cvs diff: Diffing extras/curses/sample
cvs diff: Diffing extras/dynamic_linking
cvs diff: Diffing extras/graphics
cvs diff: Diffing extras/graphics/mercury_opengl
cvs diff: Diffing extras/graphics/mercury_tcltk
cvs diff: Diffing extras/graphics/samples
cvs diff: Diffing extras/graphics/samples/calc
cvs diff: Diffing extras/graphics/samples/maze
cvs diff: Diffing extras/graphics/samples/pent
cvs diff: Diffing extras/lazy_evaluation
cvs diff: Diffing extras/lex
cvs diff: Diffing extras/lex/samples
cvs diff: Diffing extras/logged_output
cvs diff: Diffing extras/moose
cvs diff: Diffing extras/moose/samples
cvs diff: Diffing extras/morphine
cvs diff: Diffing extras/morphine/non-regression-tests
cvs diff: Diffing extras/morphine/scripts
cvs diff: Diffing extras/morphine/source
cvs diff: Diffing extras/odbc
cvs diff: Diffing extras/posix
cvs diff: Diffing extras/quickcheck
cvs diff: Diffing extras/quickcheck/tutes
cvs diff: Diffing extras/references
cvs diff: Diffing extras/references/samples
cvs diff: Diffing extras/references/tests
cvs diff: Diffing extras/stream
cvs diff: Diffing extras/trailed_update
cvs diff: Diffing extras/trailed_update/samples
cvs diff: Diffing extras/trailed_update/tests
cvs diff: Diffing extras/xml
cvs diff: Diffing extras/xml/samples
cvs diff: Diffing java
cvs diff: Diffing java/library
cvs diff: Diffing java/runtime
cvs diff: Diffing library
Index: library/pprint.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/pprint.m,v
retrieving revision 1.10
diff -u -b -r1.10 pprint.m
--- library/pprint.m	2002/05/13 03:19:45	1.10
+++ library/pprint.m	2002/07/15 04:52:32
@@ -1,4 +1,4 @@
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 % pprint.m
 % Copyright (C) 2000-2002 Ralph Becket <rbeck at microsoft.com>
 % Wed Mar 22 17:44:32  2000
@@ -149,7 +149,7 @@
 %   Look!    cruel
 %   Look!    world
 %
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- module pprint.
 
@@ -366,12 +366,12 @@
 :- pred write(io__output_stream, int, T, io__state, io__state) <= doc(T).
 :- mode write(in, in, in, di, uo) is det.
 
-%------------------------------------------------------------------------------%
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- implementation.
 
-:- import_module array, map, exception.
+:- import_module array, map, sparse_bitset, enum, term, exception.
 
 :- type doc
     --->    'NIL'
@@ -394,11 +394,11 @@
 :- type map_pair(K, V)
     --->    map_pair(K, V).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 doc(X) = doc(int__max_int, X).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- instance doc(doc)       where [ doc(_, Doc)    = Doc            ].
 :- instance doc(string)    where [ doc(_, String) = text(String)   ].
@@ -406,11 +406,11 @@
 :- instance doc(float)     where [ doc(_, Float)  = poly(f(Float)) ].
 :- instance doc(char)      where [ doc(_, Char)   = poly(c(Char))  ].
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 Doc1 ++ Doc2 = doc(Doc1) `<>` doc(Doc2).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 nil                     = 'NIL'.
 X `<>` Y                = 'SEQ'(X, Y).
@@ -425,7 +425,7 @@
 poly(i(I))              = text(string__format("%d", [i(I)])).
 poly(f(F))              = text(string__format("%f", [f(F)])).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 to_string(W, X) = S :-
     layout_best(pred(H::in, T::in, [H | T]::out) is det, W, X, [], Ss),
@@ -435,7 +435,7 @@
 
 write(Stream, W, X)     --> layout_best(io__write_string(Stream), W, doc(X)).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
     % This is a contraction of Wadler's pretty, layout and be
     % functions, adapted to work with a strict evaluation order.
@@ -500,7 +500,7 @@
     K = K0 + string__length(T),
     P(T, S0, S).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
     % Decide if a flattened doc will fit on the remainder of the line.
     %
@@ -524,7 +524,7 @@
     L = string__length(S),
     R > L.
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
     % Lay out a doc in its flattened form.
     %
@@ -556,24 +556,24 @@
     K = K0 + string__length(T),
     P(T, S0, S).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- func extend(string, int) = string.
 
 extend(I, J) = I ++ string__duplicate_char(' ', J).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 X `</>` Y               = X ++ line ++ Y.
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 bracketed(L, R, D)      = L ++ D ++ R.
 parentheses(D)          = bracketed("(", ")", D).
 brackets(D)             = bracketed("[", "]", D).
 braces(D)               = bracketed("{", "}", D).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 separated(_,  _,   []) = nil.
 
@@ -582,7 +582,7 @@
                  else PP(X) ++ (Sep ++ separated(PP, Sep, Xs))
     ).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 packed(_N, _Sep, []           ) =
     nil.
@@ -596,30 +596,36 @@
       else group(line ++ ellipsis)
     ).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 packed(Sep, Xs) = packed(int__max_int, Sep, Xs).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 packed_cs(N, Xs) = packed(N, ", ", Xs).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 packed_cs(Xs) = packed(", ", Xs).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 packed_cs_to_depth(Depth, Xs) =
     packed_cs(Depth, list__map(to_doc(Depth), Xs)).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 packed_cs_univ_args(Depth, UnivArgs) =
     packed_cs(Depth, list__map(func(UA) = 'DOC'(Depth, UA), UnivArgs)).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
+word_wrapped(String) =
+    packed(space, list__map(func(Word) = text(Word),
+                            string__words(char__is_whitespace, String))).
+
+%-----------------------------------------------------------------------------%
+
 comma                   = text(",").
 semic                   = text(";").
 colon                   = text(":").
@@ -636,18 +642,26 @@
 colon_space_line        = ": " ++ line.
 ellipsis                = text("...").
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 to_doc(X) = to_doc(int__max_int, X).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
     % This may throw an exception or cause a runtime abort if the term
     % in question has user-defined equality.
     %
 to_doc(Depth, X) =
-    (
-      if      dynamic_cast_to_list(X, List)
+    ( if      dynamic_cast_to_var(X, Var)
+      then    var_to_doc(Depth, Var)
+
+      else if dynamic_cast_to_sparse_bitset_of_int(X, SparseBitsetInt)
+      then    sparse_bitset_to_doc(Depth, SparseBitsetInt)
+
+      else if dynamic_cast_to_sparse_bitset_of_var(X, SparseBitsetVar)
+      then    sparse_bitset_to_doc(Depth, SparseBitsetVar)
+
+      else if dynamic_cast_to_list(X, List)
       then    list_to_doc(Depth, List)
 
       else if dynamic_cast_to_array(X, Array)
@@ -662,14 +676,71 @@
       else if dynamic_cast_to_map_pair(X, MapPair)
       then    map_pair_to_doc(Depth, MapPair)
 
-      else if Depth =< 0
-      then    out_of_depth_term_to_doc(X)
-
       else    generic_term_to_doc(Depth, X)
     ).
 
+%-----------------------------------------------------------------------------%
+
+:- func generic_term_to_doc(int, T) = doc.
+
+generic_term_to_doc(Depth, X) = Doc :-
+    ( if Depth =< 0
+      then
+        functor(X, Name, Arity),
+        Doc =
+            ( if Arity = 0
+              then text(Name)
+              else Name ++ "/" ++ Arity
+            )
+      else
+        deconstruct(X, Name, Arity, UnivArgs),
+        Doc =
+            ( if Arity = 0
+              then  text(Name)
+              else  group(
+                        Name ++ parentheses(
+                            nest(2, packed_cs_univ_args(Depth - 1, UnivArgs))
+                        )
+                    )
+            )
+    ).
+
+%-----------------------------------------------------------------------------%
+
+:- some [T2] pred dynamic_cast_to_var(T1, var(T2)).
+:-           mode dynamic_cast_to_var(in, out) is semidet.
+
+dynamic_cast_to_var(X, V) :-
+
+        % If X is a var then it has a type with one type argument.
+        %
+    [ArgTypeDesc] = type_args(type_of(X)),
+
+        % Convert ArgTypeDesc to a type variable ArgType.
+        %
+    (_ `with_type` ArgType) `has_type` ArgTypeDesc,
+
+        % Constrain the type of V to be var(ArgType) and do the
+        % cast.
+        %
+    dynamic_cast(X, V `with_type` var(ArgType)).
+
+%-----------------------------------------------------------------------------%
+
+:- pred dynamic_cast_to_sparse_bitset_of_int(T1, sparse_bitset(int)).
+:- mode dynamic_cast_to_sparse_bitset_of_int(in, out) is semidet.
+
+dynamic_cast_to_sparse_bitset_of_int(X, A) :-
+        dynamic_cast(X, A `with_type` sparse_bitset(int)).
+
+:- some [T2]
+   pred dynamic_cast_to_sparse_bitset_of_var(T1, sparse_bitset(var(T2))).
+:- mode dynamic_cast_to_sparse_bitset_of_var(in, out) is semidet.
+
+dynamic_cast_to_sparse_bitset_of_var(X, A) :-
+        dynamic_cast(X, A `with_type` sparse_bitset(var)).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- some [T2] pred dynamic_cast_to_array(T1, array(T2)).
 :-           mode dynamic_cast_to_array(in, out) is semidet.
@@ -689,7 +760,7 @@
         %
     dynamic_cast(X, A `with_type` array(ArgType)).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- some [T2] pred dynamic_cast_to_list(T1, list(T2)).
 :-           mode dynamic_cast_to_list(in, out) is semidet.
@@ -709,7 +780,7 @@
         %
     dynamic_cast(X, L `with_type` list(ArgType)).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- some [T2, T3] pred dynamic_cast_to_map(T1, map(T2, T3)).
 :-               mode dynamic_cast_to_map(in, out) is semidet.
@@ -730,7 +801,7 @@
         %
     dynamic_cast(X, M `with_type` map(KeyType, ValueType)).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- some [T2, T3] pred dynamic_cast_to_map_pair(T1, map_pair(T2, T3)).
 :-               mode dynamic_cast_to_map_pair(in, out) is semidet.
@@ -751,7 +822,7 @@
         %
     dynamic_cast(X, MP `with_type` map_pair(KeyType, ValueType)).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- pred dynamic_cast_to_tuple(T, T).
 :- mode dynamic_cast_to_tuple(in, out) is semidet.
@@ -762,37 +833,32 @@
         %
     functor(X, "{}", _Arity).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
-:- func out_of_depth_term_to_doc(T) = doc.
+:- func var_to_doc(int, var(T)) = doc.
 
-out_of_depth_term_to_doc(X) = Doc :-
+var_to_doc(Depth, V) =
+    to_doc(Depth, to_int(V)).
 
-    functor(X, Name, Arity),
-
-    Doc = ( if Arity = 0 then text(Name)
-                         else Name ++ "/" ++ Arity
-    ).
+%-----------------------------------------------------------------------------%
 
-%------------------------------------------------------------------------------%
+    % XXX Ideally we'd just walk the sparse bitset.  But that's an optimization
+    % for another day.
+    %
+:- func sparse_bitset_to_doc(int, sparse_bitset(T)) = doc <= enum(T).
 
-:- func generic_term_to_doc(int, T) = doc.
+sparse_bitset_to_doc(Depth, A) =
+    group("sparse_bitset" ++
+        parentheses(list_to_doc(Depth - 1, sparse_bitset__to_sorted_list(A)))).
 
-generic_term_to_doc(Depth, X) = Doc :-
+%-----------------------------------------------------------------------------%
 
-    deconstruct(X, Name, Arity, UnivArgs),
+:- func list_to_doc(int, list(T)) = doc.
 
-    Doc =
-        ( if    Arity = 0
-          then  text(Name)
-          else  group(
-                    Name ++ parentheses(
-                        nest(2, packed_cs_univ_args(Depth - 1, UnivArgs))
-                    )
-                )
-        ).
+list_to_doc(Depth, Xs) =
+    brackets(nest(1, packed_cs_to_depth(Depth - 1, Xs))).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
     % XXX Ideally we'd just walk the array.  But that's an optimization
     % for another day.
@@ -802,14 +868,18 @@
 array_to_doc(Depth, A) =
     group("array" ++ parentheses(list_to_doc(Depth - 1, array__to_list(A)))).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
-:- func list_to_doc(int, list(T)) = doc.
+    % This should only really be used if the item in question really
+    % is a tuple.
+    %
+:- func tuple_to_doc(int, T) = doc.
 
-list_to_doc(Depth, Xs) =
-    brackets(nest(1, packed_cs_to_depth(Depth - 1, Xs))).
+tuple_to_doc(Depth, Tuple) = Doc :-
+    deconstruct(Tuple, _Name, _Arity, UnivArgs),
+    Doc = group(braces(nest(1, packed_cs_univ_args(Depth - 1, UnivArgs)))).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- func map_to_doc(int, map(T1, T2)) = doc.
 
@@ -817,34 +887,16 @@
     KVs = list__map(mk_map_pair, map__to_assoc_list(X)),
     Doc = group("map" ++ parentheses(list_to_doc(Depth - 1, KVs))).
 
-
 :- func mk_map_pair(pair(K, V)) = map_pair(K, V).
 
 mk_map_pair(K - V) = map_pair(K, V).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
 
 :- func map_pair_to_doc(int, map_pair(T1, T2)) = doc.
 
 map_pair_to_doc(Depth, map_pair(Key, Value)) =
     to_doc(Depth - 1, Key) ++ text(" -> ") ++
         group(nest(2, line ++ to_doc(Depth - 1, Value))).
-
-%------------------------------------------------------------------------------%
-
-    % This should only really be used if the item in question really
-    % is a tuple.
-    %
-:- func tuple_to_doc(int, T) = doc.
-
-tuple_to_doc(Depth, Tuple) = Doc :-
-    deconstruct(Tuple, _Name, _Arity, UnivArgs),
-    Doc = group(braces(nest(1, packed_cs_univ_args(Depth - 1, UnivArgs)))).
-
-%------------------------------------------------------------------------------%
-
-word_wrapped(String) =
-    packed(space, list__map(func(Word) = text(Word),
-                            string__words(char__is_whitespace, String))).
 
-%------------------------------------------------------------------------------%
+%-----------------------------------------------------------------------------%
cvs diff: Diffing profiler
cvs diff: Diffing robdd
cvs diff: Diffing runtime
cvs diff: Diffing runtime/GETOPT
cvs diff: Diffing runtime/machdeps
cvs diff: Diffing samples
cvs diff: Diffing samples/c_interface
cvs diff: Diffing samples/c_interface/c_calls_mercury
cvs diff: Diffing samples/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/c_interface/mercury_calls_c
cvs diff: Diffing samples/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/diff
cvs diff: Diffing samples/muz
cvs diff: Diffing samples/rot13
cvs diff: Diffing samples/solutions
cvs diff: Diffing samples/tests
cvs diff: Diffing samples/tests/c_interface
cvs diff: Diffing samples/tests/c_interface/c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/cplusplus_calls_mercury
cvs diff: Diffing samples/tests/c_interface/mercury_calls_c
cvs diff: Diffing samples/tests/c_interface/mercury_calls_cplusplus
cvs diff: Diffing samples/tests/c_interface/mercury_calls_fortran
cvs diff: Diffing samples/tests/c_interface/simpler_c_calls_mercury
cvs diff: Diffing samples/tests/c_interface/simpler_cplusplus_calls_mercury
cvs diff: Diffing samples/tests/diff
cvs diff: Diffing samples/tests/muz
cvs diff: Diffing samples/tests/rot13
cvs diff: Diffing samples/tests/solutions
cvs diff: Diffing samples/tests/toplevel
cvs diff: Diffing scripts
cvs diff: Diffing tests
cvs diff: Diffing tests/benchmarks
cvs diff: Diffing tests/debugger
cvs diff: Diffing tests/debugger/declarative
cvs diff: Diffing tests/dppd
cvs diff: Diffing tests/general
cvs diff: Diffing tests/general/accumulator
cvs diff: Diffing tests/general/structure_reuse
cvs diff: Diffing tests/hard_coded
Index: tests/hard_coded/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/Mmakefile,v
retrieving revision 1.157
diff -u -b -r1.157 Mmakefile
--- tests/hard_coded/Mmakefile	2002/06/30 17:07:15	1.157
+++ tests/hard_coded/Mmakefile	2002/07/16 07:43:25
@@ -100,6 +100,7 @@
 	nondet_ctrl_vn \
 	nondet_copy_out \
 	nullary_ho_func \
+	pprint_test \
 	pragma_c_code \
 	pragma_export \
 	pragma_import \
Index: tests/hard_coded/pprint_test.exp
===================================================================
RCS file: pprint_test.exp
diff -N pprint_test.exp
--- /dev/null	Fri Dec  1 02:25:58 2000
+++ pprint_test.exp	Tue Jul 16 18:06:08 2002
@@ -0,0 +1,11 @@
+1
+2
+[5, 6]
+["five", "six", "seven"]
+[1, 2]
+sparse_bitset([42])
+sparse_bitset([42, 84])
+map([41 -> 42])
+map([41 -> 42, 82 -> 83])
+array([1, 2, 3])
+{7, 8, "abc"}
Index: tests/hard_coded/pprint_test.m
===================================================================
RCS file: pprint_test.m
diff -N pprint_test.m
--- /dev/null	Fri Dec  1 02:25:58 2000
+++ pprint_test.m	Tue Jul 16 18:06:00 2002
@@ -0,0 +1,59 @@
+% Test to_doc's special handling of some types.
+
+:- module pprint_test.
+
+:- interface.
+:- import_module io.
+
+:- pred main(io__state::di, io__state::uo) is det.
+
+:- implementation.
+:- import_module int, varset, term, list, sparse_bitset, map, array, pprint.
+
+:- func line_length = int.
+
+line_length = 72.
+
+:- pred get_new_vars(var(int)::out, var(int)::out) is det.
+
+get_new_vars(Var1, Var2) :-
+	varset__init(VarSet0),
+	varset__new_var(VarSet0, Var1, VarSet1),
+	varset__new_var(VarSet1, Var2, _VarSet2).
+
+main -->
+	{ get_new_vars(Var1, Var2) },
+ 	pprint__write(line_length, to_doc(Var1)),
+	io__nl,
+ 	pprint__write(line_length, to_doc(Var2)),
+	io__nl,
+
+ 	pprint__write(line_length, to_doc([5, 6])),
+	io__nl,
+ 	pprint__write(line_length, to_doc(["five", "six", "seven"])),
+	io__nl,
+ 	pprint__write(line_length, to_doc([Var1, Var2])),
+	io__nl,
+
+	{ Set0 = sparse_bitset__init },
+	{ sparse_bitset__insert(Set0, 42, Set1) },
+	{ sparse_bitset__insert(Set1, 84, Set2) },
+ 	pprint__write(line_length, to_doc(Set1)),
+	io__nl,
+ 	pprint__write(line_length, to_doc(Set2)),
+	io__nl,
+
+	{ Map0 = map__init },
+	{ map__det_insert(Map0, 41, 42, Map1) },
+	{ map__det_insert(Map1, 82, 83, Map2) },
+ 	pprint__write(line_length, to_doc(Map1)),
+	io__nl,
+ 	pprint__write(line_length, to_doc(Map2)),
+	io__nl,
+
+	{ array__from_list([1, 2, 3], Array) },
+ 	pprint__write(line_length, to_doc(Array)),
+	io__nl,
+
+ 	pprint__write(line_length, to_doc({7, 8, "abc"})),
+	io__nl.
cvs diff: Diffing tests/hard_coded/exceptions
cvs diff: Diffing tests/hard_coded/purity
cvs diff: Diffing tests/hard_coded/sub-modules
cvs diff: Diffing tests/hard_coded/typeclasses
cvs diff: Diffing tests/invalid
cvs diff: Diffing tests/invalid/purity
cvs diff: Diffing tests/misc_tests
cvs diff: Diffing tests/recompilation
cvs diff: Diffing tests/tabling
cvs diff: Diffing tests/term
cvs diff: Diffing tests/valid
cvs diff: Diffing tests/warnings
cvs diff: Diffing tools
cvs diff: Diffing trace
cvs diff: Diffing util
cvs diff: Diffing vim
cvs diff: Diffing vim/after
cvs diff: Diffing vim/ftplugin
cvs diff: Diffing vim/syntax
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list