[m-dev.] Adding Loops to Mercury

Peter Schachte pschachte at gmail.com
Thu Jan 9 09:25:21 AEDT 2014

On 08/01/14 23:58, Mark Brown wrote:

> Currently in Mercury I can define an instance for foldable(map(K, V),
> pair(K, V)), but not foldable(list(T), T) or foldable(set(T), T).

That's weird.  I can't see why the former would be workable if the
latter two are not.

Would foldable(list(T), useless_wrapper(T)) work, where

    :- type useless_wrapper(T) ---> useless_wrapper(T).

Peter Schachte               Politics, n. A strife of interests
University of Melbourne      masquerading as a contest of principles.
schachte at unimelb.edu.au      The conduct of public affairs for private
www.cs.mu.oz.au/~schachte/   advantage. -- Ambrose Bierce, 1906 (The
Phone: +61 3 8344 1338       Devil's Dictionary)
I support the NTEU's campaign for a fair enterprise agreement.
Find out more: nteu.org.au/melb | facebook.com/nteu.unimelb

More information about the developers mailing list