[m-dev.] for review: function def's for single out det mode library predicates
Ralph Becket
rwab1 at cam.sri.com
Thu Jul 8 18:41:03 AEST 1999
> In addition to my previous comments about the changes I would make
> to Ralph Becket's change before committing it, here is one more:
>
> > + % General purpose higher-order programming constructs.
> > +
> > + % o(F, G, X) = F(G(X))
> > + %
> > + % Function composition.
> > + % XXX It would be nice to have infix `o' or somesuch for this.
> > +:- func o(func(T2) = T3, func(T1) = T2, T1) = T3.
>
> I renamed that function as `compose'.
I originally named it `compose', but changed it to `o' to fit in with
the ML world. I still maintain that an infix composition operator
would be a handy thing.
What's the status of setting up your own operators? On the one hand
I'm against it seeing how the facility gets abused by novice Prolog
programmers; on the other it seems genuinely useful for such functions
as the above and for e.g. coding in the monadic style.
Ralph
--
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