Re: Type-classes and call-time choice vs. run-time choice

From: Bernd Brassel <bbr_at_informatik.uni-kiel.de>
Date: Fri, 28 Aug 2009 17:31:06 +0200

Am Aug 28, 2009 um 5:02 PM schrieb Sebastian Fischer:

>
> On Aug 28, 2009, at 3:57 PM, Bernd Brassel wrote:
>
>> What are the values of plus(f (0?1)) and plus'(f' (0?1))
>
> In your example no value of type ETC2 a or ETC2' a is ever shared.
> If I understood Wolfgangs proposal correctly, then the annotations
> imply that if a value of the declared data type is shared then the
> annotated arguments are not shared. At least this is how i
> implemented it..
>
> As a consequence, the results of both of your calls are 0 or 2 with
> the explicit sharing library -- like without any annotation.

Okay, then how about the following example: for the declarations

data C a = C ?a
plus (C x) (C y) = x+y

do the following expressions all have the same semantics?

e1 = let x=C (0?1) in plus x x
e2 = let y=0?1 in let x=C y in plus x x
e3 = let y=0?1 in let x=C y in const (plus x x) y

_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Fr Aug 28 2009 - 18:15:11 CEST

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:10 CEST