Re: Incoherence

2001-10-25 Thread Lennart Augustsson
John Hughes wrote: > We can construct rather large polymorphic values, which have > to be converted in linear time to the same value of a > different type. > > > All true, but I doubt whether any of this is a big deal. MLers already live > with their "value restriction", w

Re: Incoherence

2001-10-25 Thread John Hughes
John Hughes wrote: | `x := []' wouldn't be problematic, just monomorphic. | That is, x must be used consistently as a list of a | particular type. Just to check if I understand you correctly. In your proposal, does the following thing share `x

Re: Incoherence

2001-10-25 Thread Marcin 'Qrczak' Kowalczyk
Thu, 25 Oct 2001 09:47:31 +, Levent Erkok <[EMAIL PROTECTED]> pisze: > Another place where `:=' bindings are badly needed is the recursive > do-notation (mdo, as supported in hugs.) In an mdo, let bindings > have to be monomorphic, because they are passed back to the mfix > loop in a lambda b

Re: Incoherence

2001-10-25 Thread Ross Paterson
On Thu, Oct 25, 2001 at 09:47:31AM +, Levent Erkok wrote: > Another place where `:=' bindings are badly needed is the recursive > do-notation (mdo, as supported in hugs.) In an mdo, let bindings have > to be monomorphic, because they are passed back to the mfix loop in a > lambda binding. Henc

Re: Incoherence

2001-10-25 Thread Levent Erkok
On Thursday 25 October 2001 07:21 am, John Hughes wrote: > My proposal is that := should bind *monomorphically* -- just like lambda > binding. The motivation for that is that a polymorphic function can easily > become overloaded after a small change to the program, such as adding > removal of dupl

Re: Incoherence

2001-10-25 Thread Karl-Filip Faxen
Hi! The binding form := must absolutely have a completely monomorphic type. A while back I posted the result that the MR kills principal types in Haskell. The problem with the MR is exactly that it introduces types which may be polymorphic but not overloaded. So if we want to regain principal typ

Re: Incoherence

2001-10-25 Thread Koen Claessen
John Hughes wrote: | `x := []' wouldn't be problematic, just monomorphic. | That is, x must be used consistently as a list of a | particular type. Just to check if I understand you correctly. In your proposal, does the following thing share `x'? let x = fac 100 in x + x (My understanding

Re: Incoherence

2001-10-24 Thread John Hughes
John Hughes wrote: > What we need is different binding syntax for monomorphic and polymorphic > bindings. Roll on := and = ... I agree absolutely that we need such a distinction. Although it's worth clarifying a point. The monomorphism restriction doesn

Re: Incoherence

2001-10-24 Thread Jeffrey R Lewis
John Hughes wrote: > What we need is different binding syntax for monomorphic and polymorphic > bindings. Roll on := and = ... I agree absolutely that we need such a distinction. Although it's worth clarifying a point. The monomorphism restriction doesn't exclude polymorphism, just overloadin

Re: Incoherence

2001-10-24 Thread John Hughes
John Hughes wrote: > What we need is different binding syntax for monomorphic and polymorphic > bindings. Roll on := and = ... If I recall correctly, in some earlier language (KRC?) this difference was achieved by letting let-bindings be polymorp

Re: Incoherence

2001-10-24 Thread kahl
John Hughes wrote: > What we need is different binding syntax for monomorphic and polymorphic > bindings. Roll on := and = ... If I recall correctly, in some earlier language (KRC?) this difference was achieved by letting let-bindings be polymorphic, and where-bindings be monomorphic. The ide

Re: Incoherence

2001-10-23 Thread John Hughes
John Hughes wrote: > I noticed today that the presence or absence of a type signature can > change the RESULT of an expression in Hugs and GHC nowadays. Here's an > example: > > a = (let x = ?x in > x with ?x = 1) >

Re: Incoherence

2001-10-23 Thread John Launchbury
John, As I recall, this was something we addressed in the original paper, indicating the extreme danger of the monomorphism restriction in the context of implicit paramters. They simply don't mix. Down with the MR. Let's settle on a viable alternative as soon as possible. On the more general

Re: Incoherence

2001-10-23 Thread Marcin 'Qrczak' Kowalczyk
Tue, 23 Oct 2001 08:00:34 -0700, Jeffrey R Lewis <[EMAIL PROTECTED]> pisze: > The best solution is to find a good way to eliminate the DMR. Separating syntaxes of function definition and pattern binding would have the right effect IMHO, but it's a radical change which breaks compatibility and cu

Re: Incoherence

2001-10-23 Thread Jeffrey R Lewis
John Hughes wrote: > I noticed today that the presence or absence of a type signature can > change the RESULT of an expression in Hugs and GHC nowadays. Here's an > example: > > a = (let x = ?x in > x with ?x = 1) > with ?x = 2 > -- a == 2 > > b = (let x :: (?x :: Int

Re: Incoherence

2001-10-23 Thread Koen Claessen
John Hughes wrote: | I noticed today that the presence or absence of a type | signature can change the RESULT of an expression in | Hugs and GHC nowadays. This has been a property of the Haskell language since the defaulting mechanism already! Here is an example: a = let x = 1 in show x

Incoherence

2001-10-23 Thread John Hughes
I noticed today that the presence or absence of a type signature can change the RESULT of an expression in Hugs and GHC nowadays. Here's an example: a = (let x = ?x in x with ?x = 1) with ?x = 2 -- a == 2 b = (let x :: (?x :: Integer) => Integer x = ?x