[mercury-users] Mercury 11.07 released

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Dec 22 15:32:43 AEDT 2011

We are pleased to announce the release of version 11.07 of the Mercury system.

Mercury is a general-purpose programming language, designed and
implemented by a group of researchers at the University of Melbourne,
Australia.  Mercury is based on the paradigm of purely declarative
programming, and was designed to be useful for the development of large
and robust real-world applications.  It improves on existing logic
programming languages by providing increased productivity, reliability
and efficiency, and by avoiding the need for non-logical program
constructs.  Mercury provides the traditional logic programming syntax,
but also allows the syntactic convenience of user-defined functions,
smoothly integrating logic and functional programming into a single

For more information about Mercury, see the Mercury web page at

To download Mercury 11.07,
see <http://www.mercury.csse.unimelb.edu.au/download/release.html>.

NEWS for Mercury 11.07


Changes to the Mercury language:

* The `char' type now represents a Unicode code point.

* Unicode characters can now be encoded in string literals using an
     escape sequence.  The escape sequence \uXXXX (or \UXXXXXXXX), where XXXX
     (or XXXXXXXX) is a Unicode character code in hexadecimal, is replaced with
     the corresponding Unicode character.

* Expressions used to initialise mutables may now contain impure
     or semipure function calls.

Changes to the Mercury standard library:

* We have improved Unicode support in the standard library.

* We have deprecated substring procedures which take start and count
     arguments in favour of procedures which take start and end arguments.

* We have changed the argument order of many of the predicates in the array,
     bag, bimap, eqvclass, map, multi_map, queue and set modules in order
     to make them more conducive to the use of state variable notation.

Changes to the Mercury compiler:

* Support for using clang (<http://clang.llvm.org/>) as a C compiler with
     Mercury has been added.  See README.clang for further details

* We have significantly improved support for using Microsoft Visual C as
     a C compiler with Mercury.  See README.MS-VisualC for further details.

* The Java code generated by the Java backend is now compatible with Java 1.7.

Changes to the Mercury profiler:

* We have added a new form of profiling, memory retention profiling, to mprof
     that allows it to generate reports describing the origin of objects that
     are live on the heap at selected points in a program.
     See the Mercury User's Guide for details.


Changes to the Mercury standard library:

* We have improved Unicode support in the standard library.

       + Procedures in the string module now understand either UTF-8 or
         UTF-16 encodings, depending upon the backend.

       + Text I/O routines now read and write files in UTF-8 encoding.

* We have deprecated substring procedures which take start and count
     arguments in favour of procedures which take start and end arguments.
     The new procedures are more convenient to call, make more sense with
     variable-width character encodings, and pave the way for potentially
     replacing string offsets with an abstract type.

* We have added additional modes for set.map/3 and set.map_fold/5.

* The argument order of the following predicates has been changed so as to
     make them more conducive to the use of state variable notation:
     array.set/4, array.semidet/4, array.slow_set/4, array.semidet_slow_set/4,
     array.resize/4, array.shrink/3, bag.insert/3, bag.insert_list/3,
     bag.insert_set/3, bag.remove/3, bag.det_remove/3, bag.remove_list/3,
     bag.remove_set/3, bag.delete/3, bag.remove_all/3, bag.delete_all/3,
     bag.remove_smallest/3, bimap.insert/4, bimap.det_insert/4, bimap.set/4,
     eqvclass.ensure_element/3, eqvclass.new_element/3,
     eqvclass.ensure_equivalence/4, eqvclass.new_equivalence/4,
     eqvclass.remove_equivalent_elements/3, map.insert/4, map.det_insert/4,
     map.det_insert_from_assoc_list/3, map.set_from_corresponding_lists/4,
     map.set_from_assoc_list/3, map.update/4, map.det_update/4, map.delete/3,
     map.delete_list/3, map.remove/4, map.det_remove/4, map.remove_smallest/4,
     multi_map.insert/4, multi_map.det_insert/4, multi_map.update/4,
     multi_map.det_update/4, multi_map.det_replace/4, multi_map.set/4,
     multi_map.add/4, multi_map.delete/4, multi_map.remove/4, and
     multi_map.remove_smallest/4, queue.put/3, queue.put_list/3,
     queue.get/3, queue.delete_all/3, queue.put_on_front/3,
     queue.get_from_back/3, queue.put_list_on_front/3,
     queue.get_from_back/3, rbtree.insert/4, rbtree.update/4, rbtree.set/4,
     rbtree.delete/3, rbtree.remove_smallest/4, rbtree.remove_largest/4,
     set.insert/3, set.insert_list/3, set.delete/3, set.delete_list/3,
     set.remove/3, set.remove_list/3, set.remove_least/3, tree234.insert/4,
     set_bbbtree.insert/3, set_bbbtree.insert_list/3, set_bbbtree.delete/3,
     set_bbbtree.delete_list/3, set_bbbtree.remove/3, set_bbbtree.remove_list/3,
     set_bbbtree.remove_least/3, set_bbbtree.remove_largest/3,
     set_ordlist.insert/3, set_ordlist.insert_list/3, set_ordlist.delete/3,
     set_ordlist.delete_list/3, set_ordlist.remove/3, set_ordlist.remove_list/3,
     set_ordlist.remove_least/3, set_unordlist.insert/3,
     set_unordlist.insert_list/3, set_unordlist.delete/3,
     set_unordlist.delete_list/3, set_unordlist.remove/3,
     set.unordlist.remove_list/3, set_unordlist.remove_least/3,
     sparse_bitset.insert/3, sparse_bitset.insert_list/3, sparse_bitset.delete/3,
     sparse_bitset.delete_list/3, sparse_bitset.remove/3,
     sparse_bitset.remove_list/3, sparse_bitset.remove_leq/3,
     sparse_bitset.remove_gt/3, sparse_bitset.remove_least/3,
     term.create_var/3, tree234.set/4, tree234.remove/4, tree234.remove_smallest/4,
     tree234.update/4, tree_bitset.insert/3, tree_bitset.insert_list/3,
     tree_bitset.delete/3, tree_bitset.delete_list/3, tree_bitset.remove/3,
     tree_bitset.remove_list/3 and tree_bitset.remove_least/3.

* We have add the following new functions for creating singleton
     maps: bimap.singleton/2, injection.singleton/2, map.singleton/2,
     rbtree.singleton/2 and tree234.singleton/2.

* The following procedures have been added to the standard library:


      They replace the following procedures, which are now obsolete and will be
      removed in a later release:


* The following procedures are have been deprecated and will be removed in
     a future release: dir.basename_det/1, list.replace_nth_det/3,
     list.replace_nth_det/4, list.index0_det/2, list.index1_det/2,
     list.index0_det/2, list.index1_det/2, list.last_det/1, stack.top_det/1,
     stack.pop_det/3, string.remove_suffix_det/2, string.index_det/2,
     string.index_det/3, string.set_char_det/3, string.set_char_det/4 and

     The versions of these procedures that use "det_" as a prefix should be
     used instead.  (We have added these where they did not already exist.)

* The deprecated modules graph, group and relation are no longer included
     in the library.

* The following predicates have been added to the modules that provide sets
     in the library: set.is_empty/1, set_bbbtree.is_empty/1,
     set_ctree234.is_empty/1, set_ordlist.is_empty/1, set_tree234.is_empty/1,
     set_unordlist.is_empty/1, sparse_bitset.is_empty/1, tree_bitset.is_empty/1,
     set.filter/4, set_bbbtree.filter/3, set_bbbtree.filter/4, set_ctree.filter/3,
     set_ctree.filter/4, set_ordlist.filter/3, set_ordlist.filter/4,
     set_tree.filter/3, set_tree.filter/4, set_unordlist.filter/3,
     set_unordlist.filter/4, sparse_bitset.filter/3, sparse_bitset.filter/4,
     tree_bitset.filter/3, tree_bitset.filter/4.

     All the is_empty predicates are synonyms for the existing empty/1 predicates
     in those modules.

* We have added the predicate pqueue.det_remove/4.  It is like pqueue.remove/4
     except that it throws an exception instead of failing if the priority queue
     is empty.

* The new modules svlist, svstack and svpqueue provide state variable friendly
     versions of predicates in the list, stack and pqueue modules.
     (As with the other sv* modules these modules are intended to pave the
     way for an eventual change of the predicate argument ordering in the
     list, stack and pqueue modules.)

* We have added additional modes with unique and mostly-unique accumulators
     to rbtree.foldl/4, rbtree.foldl2/6 and tree_bitset.foldl/4.

* A new function, array.generate/2, and new predicate, array.generate_foldl/5,
     can be used to create and fill new arrays.

* We have added the new predicate assoc_list.foldl_keys/4 and
     assoc_list.foldl_values/4 for folding over just keys or values
     an association list.

* We have added the new function array.from_reverse_list/1, which creates
     a new array from a list with the elements of the array occurring in
     the reverse order to that of the list.

* We have added the predicate maybe.map_fold3_maybe/9 and also added
     additional modes for maybe.fold_maybe/4, maybe.map_fold_maybe/5,
     and maybe.map_fold2_maybe/7.

* The implementation of multi_map.det_update/4 has been fixed so that it
     conforms to the documented behaviour.  The new predicate multi_map.replace/4
     has been added.

mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au

More information about the users mailing list