Re: New PAKCS release (Version 1.8.0)

From: Bernd Brassel <>
Date: Fri, 30 Mar 2007 12:36:21 +0200

Francisco Javier López Fraguas wrote:
> Consider the program
> g x = 0
> h x = 1
> fcoin = g
> fcoin = h % fcoin is a 'functional coin'
> fadd f g x = (f x) + (g x)
> fdouble f = fadd f f
> Now consider the evaluation of (fdouble fcoin 0)
> * Without eta expansion in the definition of fcoin
> (fdouble fcoin 0) returns 0 and 2
> * With eta expansion in the definition of fcoin, it returns 0,1 y 2

Very nice example!

> So, I strongly recommend to eliminate in the Curry report the paragraph
> mentioned by Wolfgang. Otherwise the report will not correspond to the
> behavior
> of the system.

This I do not understand. Should "the system" not try to correspond to
the report rather than vice versa? And do you think the system should
use eta expansion or not?

Now concerning the HO patterns:
> Wrt HO patterns, I will be glad if the FLP community adopt
> more widely the CRWL approach for HO.

Wolfgang Lux wrote
>> It seems to
>> me that introducing such patterns makes the functional type a data
>> structure which can be enhanced with new constructors in each module.
> Sure, but I do not see your problem with that. One would consider every
> function pattern as an element of a particular, potentially infinite
> type. W.r.t. pattern matching this looks very similar to matching Int
> or Float values to me.

I think the following example is at least curious (Sorry that it is not
Toy Syntax):

module M1 where
data A = A

f A = A

isF x case x of
        f -> True
        _ -> False

test = let x free in isF x=:=False

module M2
import M1

g A = A

Now, importing just M1, the expression M1.test fails. Importing M2 also
makes it succeed with [x/g]. I think it is curious that you should be
able to manipulate the behaviour of modules from the outside like this.
So I guess that you forbid '_' as a HO-Pattern? How about the extensions
to negation?


curry mailing list
Received on Fr Mär 30 2007 - 13:23:51 CEST

This archive was generated by hypermail 2.3.0 : Mi Apr 24 2024 - 07:15:09 CEST