[mercury-users] map and filter

Fergus Henderson fjh at cs.mu.OZ.AU
Fri Nov 12 15:41:00 AEDT 1999


On 12-Nov-1999, Lee Naish <lee at cs.mu.OZ.AU> wrote:
> 
> I have implemented a system which generates Prolog code for these
> predicates from algebraic type definitions (actually its more general
> than that).  See http://www.cs.mu.oz.au/~lee/papers/hose/ and check out
> the work on shape/polytypism which has come out of functional programming.
> 
> There are other shapely operations also, such as transposing a
> container of containers (I haven't implemented this one, though I now
> know how to).
> 
> I once suggested incorporating these ideas into Mercury...

You should be able to implement a generic version of these in Mercury
using Mercury's RTTI support (construct, deconstruct, get_functor,
type_name, etc. in the std_util module).

Currently it won't be very efficient, since the compiler doesn't yet
specialize calls to those RTTI functions in cases where the type
is known.  But that optimization could be done without too much work.

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