[m-dev.] for review: function def's for single out det mode library predicates
Ralph Becket
rwab1 at cam.sri.com
Thu Apr 29 01:22:59 AEST 1999
Estimated hours taken: 5
I've added functions for the single output det predicates in a number
of modules in the standard library. Basically, for each
:- pred f(in, ..., in, out) is det.
I have added the declaration
:- func f(in, ..., in) = out.
and definition
f(X1, ..., Xn) = Y :-
f(X1, ..., Xn, Y).
library/array.m:
As above, except array input modes are all array_ui or
array_di as appropriate and array output modes are array_uo.
library/char.m:
No special comments.
library/dir.m:
No special comments.
library/int.m:
Added forward versions of +/2, */2 and -/2 as plus/2, times/2
and minus/2 respectively. Also added func constants for
max_int, min_int and bits_per_int.
library/integer.m:
Replaced local functions for list head, tail and length with
calls to equivalent functions now defined in list.m.
library/io.m:
Added func for error_message/2.
library/list.m:
No special comments, other than the addition of functions
det_head/1 and det_tail/1 which abort on null lists.
library/map.m:
No special comments.
library/set.m:
No special comments, other than the addition of functions
map/2, filter_map/2 and fold/3.
library/std_util.m:
Added utility function to construct a pair object from its
arguments and general purpose higher order functions for
partial functions and for function composition, exponentiation
and exchanging the arguments of a binary function.
library/string.m:
No special comments.
Hope this helps. I've attached the diffs to this e-mail. You may
wish to reorder the resulting code: most of this has been done by
appending extra interface and implementation sections to the files.
Ralph
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3 | -- the last words of T. S. Garp.
----- End forwarded message -----
--
Ralph Becket | rwab1 at cam.sri.com | http://www.cam.sri.com/people/becket.html
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list