[m-users.] Passing field access functions to map?

Zoltan Somogyi zoltan.somogyi at runbox.com
Mon Dec 21 13:29:12 AEDT 2020


2020-12-21 12:19 GMT+11:00 "Jeremy W. Sherman" <jeremyw.sherman at gmail.com>:
> Thank you. I had read those sections, but I didn't understand
> "higher-order term" to include a term being itself passed into a
> higher-order function.
> 
> The docs talk about needing to supply "a single mode declaration", but
> I notice you supplied a function declaration (with its implicit mode
> declaration) in both cases.

You are right, that text is not as clear as it should be. The point it is trying to make
is that a higher order term in Mercury must have exactly one mode, which is why
currying a multi-moded predicate can result in an error, but in doing so, it gives the
wrong impression that you need an explicit mode declaration.
 
> Would a docs PR be welcome to provide an example alongside the description?

Yes, it would, but I have to warn you, I am a quite tough reviewer of documentation.
Or, if you want, I can write the diff, and let you review it; your choice.

Zoltan.


More information about the users mailing list