[m-dev.] Tuples and pairs

Simon Taylor stayl at cs.mu.OZ.AU
Thu Dec 20 15:46:32 AEDT 2001


On 20-Dec-2001, Peter Schachte <schachte at cs.mu.OZ.AU> wrote:
> On Thu, Dec 20, 2001 at 03:30:42PM +1100, Ralph Becket wrote:
> > A while back we discussed whether we should redefine the type pair/2 as
> > a synonym for {}/2.  I recall there was some dissent on the matter.
> > 
> > Could we have a quick show of hands for those in favour?
> 
> Abstain.

No objections here.

> > If the vote is `nay', I'm thinking of adding lhs/1 and rhs/2 to
> > std_util.m:
> > 
> > :- func lhs({L, _R}) = L.
> > lhs({L, _R}) = L.
> > 
> > :- func rhs({_L, R}) = R.
> 
> How about field access functions instead.  Maybe define
> first/1, second/1, 'first :='/1 and 'second :='/1?

We already have `fst' and `snd' for pairs. Either of the above
suggestions would cause unnecessary confusion. It would probably
be worth adding `fst :=' and `snd :='.

Simon.
--------------------------------------------------------------------------
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