[m-dev.] Inductive goals

Mark Brown mark at mercurylang.org
Thu Jan 23 21:10:23 AEDT 2014

On Thu, Jan 23, 2014 at 7:52 PM, Peter Schachte <pschachte at gmail.com> wrote:
> On 23/01/14 19:12, Mark Brown wrote:
>> On Thu, Jan 23, 2014 at 1:20 PM, Peter Schachte <pschachte at gmail.com> wrote:
>>> The keyword 'maps' seems a bit quirky.  Why not 'in'?  It reads much
>>> more naturally.
>> Given the semantics, 'maps' and 'folds' are both instances of 'in'. I
>> needed to distinguish the two cases so the syntax is unambiguous, and
>> I thought the analogy with the map and fold predicates was reasonable.
> I didn't see an 'in' in the proposal, so I don't see why you can't use
> 'in' as a generator.

Do you mean using 'in' in place of both 'maps' and 'folds', or just 'maps'?

> This proposal is reminiscent of list comprehensions, where the maps and
> folds constructs are analogous to the generator expressions.  Hence the
> proposal for incorporating filtering.
>>> Having "do true" on the end may be reasonably common; you could make the
>>> 'do' optional, and true the default goal.
>> That would lead to a "dangling do" problem. You don't want to go there.
> What associativity did you plan for 'for' to have?  I assumed it would
> be such that nested fors would need to be parenthesised, in which case
> dangling dos can't happen.

I hadn't thought that far, admittedly.


More information about the developers mailing list