Re: The madness of implicit parameters: cured?

2003-08-11 Thread Ashley Yakeley
At 2003-08-04 22:33, Ben Rudiak-Gould wrote: This illustrates what you pointed out earlier, that the program's semantics can be changed by adding explicit type signatures which include implicitly-parameterized parameters. But wasn't avoiding this a design goal of your proposal? If it is valid,

Re: The madness of implicit parameters: cured?

2003-08-07 Thread Ben Rudiak-Gould
On Mon, 4 Aug 2003, Ashley Yakeley wrote: ((\a - ((a,[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 2})) ([EMAIL PROTECTED] - @x),[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 1} ^^^ (([EMAIL PROTECTED] - @x,[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 2},[EMAIL

Re: The madness of implicit parameters: cured?

2003-08-06 Thread Ben Rudiak-Gould
On Mon, 4 Aug 2003, Ashley Yakeley wrote: At 2003-08-04 18:19, Ben Rudiak-Gould wrote: ((\a - ((a,[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 2})) ([EMAIL PROTECTED] - @x),[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 1} ^^^ (([EMAIL PROTECTED] -

Re: The madness of implicit parameters: cured?

2003-08-05 Thread Ben Rudiak-Gould
On Mon, 4 Aug 2003, Ashley Yakeley wrote: At 2003-08-04 20:00, Ben Rudiak-Gould wrote: This is a different lambda calculus, with a different beta rule. You can see the same effect in the type inference rules for implicit parameters: If f has type Int - String and ?x has type (?x :: Int) =

Re: The madness of implicit parameters: cured?

2003-08-05 Thread Ashley Yakeley
At 2003-08-04 18:19, Ben Rudiak-Gould wrote: ((\a - ((a,[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 2})) ([EMAIL PROTECTED] - @x),[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 1} ^^^ (([EMAIL PROTECTED] - @x,[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] =

Re: The madness of implicit parameters: cured?

2003-08-05 Thread Ben Rudiak-Gould
On Mon, 4 Aug 2003, Ashley Yakeley wrote: At 2003-08-04 22:33, Ben Rudiak-Gould wrote: This illustrates what you pointed out earlier, that the program's semantics can be changed by adding explicit type signatures which include implicitly-parameterized parameters. But wasn't avoiding this

Re: The madness of implicit parameters: cured?

2003-08-04 Thread Wolfgang Lux
Ben Rudiak-Gould wrote: [...] The final straw was: Prelude let ?x = 1 in let g = ?x in let ?x = 2 in g 1 Prelude let ?x = 1 in let g () = ?x in let ?x = 2 in g () 2 This is insanity. I can't possibly use a language feature which behaves in such a non-orthogonal way. Well, this is

Re: The madness of implicit parameters: cured?

2003-08-04 Thread Ben Rudiak-Gould
Trouble for implicit parameter defaults: consider ?foo = 0 let x = ?foo in (x + ?foo) { ?foo = 1 } This evaluates to 1 when the monomorphism restriction is turned on, and 2 when it's off. This is no worse than the current behavior of implicit parameters even without

Re: The madness of implicit parameters: cured?

2003-08-04 Thread Ashley Yakeley
At 2003-08-03 14:09, Ben Rudiak-Gould wrote: This reduction is incorrect. Auto-lifted parameters on the RHS of an application get lifted out I am interpreting this as Auto-lifted parameters on the RHS of an application get lifted out before [EMAIL PROTECTED] 'beta'-reduction can be done. I

Re: The madness of implicit parameters: cured?

2003-08-04 Thread Ashley Yakeley
At 2003-08-04 18:19, Ben Rudiak-Gould wrote: [EMAIL PROTECTED] - ((\a - ((a,[EMAIL PROTECTED] - @x) [EMAIL PROTECTED] = 2})) @x) If we next apply (\a - ...) to @x, something interesting happens: we have to rename to avoid variable capture. I don't see why, isn't this much the same as

Re: The madness of implicit parameters: cured?

2003-08-04 Thread Ashley Yakeley
At 2003-08-04 20:00, Ben Rudiak-Gould wrote: This is a different lambda calculus, with a different beta rule. You can see the same effect in the type inference rules for implicit parameters: If f has type Int - String and ?x has type (?x :: Int) = Int, then f ?x has type (?x :: Int) = String,

Re: The madness of implicit parameters: cured?

2003-08-03 Thread Ashley Yakeley
In article [EMAIL PROTECTED], Ben Rudiak-Gould [EMAIL PROTECTED] wrote: Now we have something almost the same as the current implicit-parameter system, except that it behaves in a much safer and saner way. Hmm... you have this: [?x,?x] [EMAIL PROTECTED] -- OK [?x] [EMAIL PROTECTED] -- OK

Re: The madness of implicit parameters: cured?

2003-08-03 Thread Ben Rudiak-Gould
First of all, thanks for reading my proposal, and I apologize for the ill-considered rant which preceded it. I hope you won't hold it against me -- we should all be on the same side here. On Sun, 3 Aug 2003, Ashley Yakeley wrote: ((let g = \_ _ - [EMAIL PROTECTED] - @x in ((g ([EMAIL

Re: The madness of implicit parameters: cured?

2003-08-03 Thread Ben Rudiak-Gould
I just noticed something interesting. Consider f #name = g where g #name = hello This apparently has type (#name :: a) - (#name :: b) - String. Should the two #names be merged? Clearly not, because ordinary positional parameters never get merged, and named parameters are supposed to be the

Re: The madness of implicit parameters: cured?

2003-08-03 Thread Derek Elkins
I kinda think someone mentioned this, perhaps even you. Or maybe I'm thinking of something else. As I'm feeling too lazy to check the archives, at the risk of saying something stupid or repeating something said, you may want to look at named instances (google should turn something up with a

Re: The madness of implicit parameters: cured?

2003-08-03 Thread Ashley Yakeley
At 2003-08-03 14:09, Ben Rudiak-Gould wrote: ((let g = \_ _ - [EMAIL PROTECTED] - @x in ((g ([EMAIL PROTECTED] - @x)) [EMAIL PROTECTED] = 2})) ([EMAIL PROTECTED] - @x))[EMAIL PROTECTED] = 1} ((let g = \_ _ - [EMAIL PROTECTED] - @x in (g 2)) ([EMAIL PROTECTED] - @x))[EMAIL PROTECTED] =

Re: The madness of implicit parameters: cured?

2003-08-03 Thread Ben Rudiak-Gould
On Sun, 3 Aug 2003, Ashley Yakeley wrote: At 2003-08-03 14:09, Ben Rudiak-Gould wrote: g ([EMAIL PROTECTED] - @x) = ([EMAIL PROTECTED] - g { @x = @x } @x) Hmm... I assume you mean specifically this: g ([EMAIL PROTECTED] - @x) [EMAIL PROTECTED] - (g { @x = @x } @x) Supposing

Re: The madness of implicit parameters: cured?

2003-08-03 Thread Ben Rudiak-Gould
On Sun, 3 Aug 2003, Derek Elkins wrote: I kinda think someone mentioned this, perhaps even you. Or maybe I'm thinking of something else. As I'm feeling too lazy to check the archives, at the risk of saying something stupid or repeating something said, you may want to look at named instances

Re: The madness of implicit parameters: cured?

2003-08-02 Thread Derek Elkins
On Sat, 2 Aug 2003 00:45:07 -0700 (PDT) Ben Rudiak-Gould [EMAIL PROTECTED] wrote: When I first learned about implicit parameters I thought they were a great idea. The honeymoon ended about the time I wrote some code of the formlet ?foo = 123 in expr2, where expr2 used ?foo implicitly, and