Re: equality of partial applications

From: Wolfgang Lux <>
Date: Tue, 19 Jun 2012 10:27:56 +0200

Sebastian Fischer wrote:

> While experimenting with $!! I may have found an MCC bug. If we define
> ignore1 _ = \x -> x
> ignore2 _ x = x
> PAKCS can distinguish ignore1 from ignore2 but MCC cannot:
> pakcs> (id $!! ignore1 failed) success
> Result: success
> pakcs> (id $!! ignore2 failed) success
> No more solutions.
> cyi> (id $!! ignore1 failed) success
> No solution
> cyi> (id $!! ignore2 failed) success
> No solution
> MCC seems to transform ignore1 into ignore2 otherwise the failure
> would be ignored in the first example.

Yes. For the sake of efficiency, MCC always eta-expands functions as much as it can.

> I would prefer if both 'ignore1 failed' and 'ignore2 failed' would be
> observably indistinguishable from 'id'.

I understand that preference and it does make sense to me. Unfortunately, it is hard to reconcile with MCC's tendency to eta-expand. Maybe in some future release.

> [...]
> But note that the Curry Report specifies constraint equality only for
> data terms. Implementations are free to implement constraint equality
> on functions in an arbitrary way and every program that relies on a
> specific way is compiler dependent. The Parser library is a nice
> example for such a compiler dependent program.


> Sebastian
> P.S. I found another MCC bug:
> cyi> (\_ -> \x -> x) failed success
> cycc: internal error: arity x.4
> I am using MCC 0.9.11 on a 64 bit Ubuntu Linux.

I cannot reproduce this bug. Can you update to the latest darcs version and see if the failure is still present? If it is, which version of ghc did you use to compile MCC?

curry mailing list
Received on Mi Jun 20 2012 - 17:56:53 CEST

This archive was generated by hypermail 2.3.0 : Fr Feb 23 2024 - 07:15:12 CET