[mercury-users] map and filter

Peter Schachte schachte at cs.mu.OZ.AU
Fri Nov 12 10:25:43 AEDT 1999


On Fri, Nov 12, 1999 at 02:21:28AM +1100, Michael Day wrote:
> Is there a conceivable container to which higher order operations such as
> map and filter and *not* applicable?

I can't think of one right now.  However, there will often be a need
for many different flavors of these.  Eg, when you map over an ordered
tree, and the function you're applying on each element is not
monotonic, you'd better be clear about what you want.  Should the
resulting tree be isomorphic to the original tree and not ordered, or
should it be ordered, and not isomorphic?  Or maybe the result should
be a different kinds of collection, eg a list?  If you filter some
sort of collection with an integrity constraint (eg, it's closed under
some operation), what should you do if the collection no longer
satisfies the integrity constraint?

Too many possibilities.  This is why I'd rather have a very general
quantification facility than a whole slew of higher-order predicates
and functions.  However, designing such a thing is very much a
research issue.


-- 
Peter Schachte                     All truth goes through three stages.
mailto:schachte at cs.mu.OZ.AU        First it is ridiculed. Then it is
http://www.cs.mu.oz.au/~schachte/  violently opposed. Finally, it is
PGP: finger schachte at 128.250.37.3  accepted as self-evident.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list