Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-22 Thread oleg
Dominic Steinitz wrote: > My motivation in using this type was to see if, for example, I could > restrict addition of a vector to another vector to vectors of the same > length. This would be helpful in the crypto library where I end up having to > either define new length Words all the time or us

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-22 Thread Frank Atanassow
On maandag, sep 22, 2003, at 00:07 Europe/Amsterdam, Brandon Michael Moore wrote: Can anyone tell me what's wrong with the following derivation? Without going through your derivation completely, the problem is almost certainly polymorphic recursion. Vector is a nested datatype---its definition c

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-21 Thread Brandon Michael Moore
On Sun, 21 Sep 2003, Dominic Steinitz wrote: > > Brandon, > > I get the error below without the type signature. My confusion was thinking > I needed rank-2 types. In fact I only need polymorphic recursion. Ross > Paterson's suggestion fixes the problem. I stole Even and Odd from Chris > Okasaki's

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-21 Thread Dominic Steinitz
OTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, September 20, 2003 5:19 PM Subject: Re: Polymorphic Recursion / Rank-2 Confusion > On Sat, Sep 20, 2003 at 12:01:32PM +0100, Dominic Steinitz wrote: > > Can anyone tell me why the following doesn't work (and what I have to do to >

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-21 Thread Dominic Steinitz
<[EMAIL PROTECTED]> To: "Dominic Steinitz" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Saturday, September 20, 2003 11:19 PM Subject: Re: Polymorphic Recursion / Rank-2 Confusion > Sorry about the empty message. Send /= Cancel > > > Can anyone tell me wh

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-20 Thread Brandon Michael Moore
Sorry about the empty message. Send /= Cancel > Can anyone tell me why the following doesn't work (and what I have to do to > fix it)? I thought by specifying the type of coalw as rank-2 would allow it > to be used both at a and (a,b). Frank explained why the type you gave wouldn't work. I would

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-20 Thread Brandon Michael Moore
On Sat, 20 Sep 2003, Ross Paterson wrote: > On Sat, Sep 20, 2003 at 12:01:32PM +0100, Dominic Steinitz wrote: > > Can anyone tell me why the following doesn't work (and what I have to do to > > fix it)? I thought by specifying the type of coalw as rank-2 would allow it > > to be used both at a and

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-20 Thread Ross Paterson
On Sat, Sep 20, 2003 at 12:01:32PM +0100, Dominic Steinitz wrote: > Can anyone tell me why the following doesn't work (and what I have to do to > fix it)? I thought by specifying the type of coalw as rank-2 would allow it > to be used both at a and (a,b). Change the signature to coal_ ::

Re: Polymorphic Recursion / Rank-2 Confusion

2003-09-20 Thread Frank Atanassow
On zaterdag, sep 20, 2003, at 13:01 Europe/Amsterdam, Dominic Steinitz wrote: Can anyone tell me why the following doesn't work (and what I have to do to fix it)? I thought by specifying the type of coalw as rank-2 would allow it to be used both at a and (a,b). This will never work. A function

Re: polymorphic recursion (was: Re: Implict parameters and monomorphism)

2001-05-06 Thread Fergus Henderson
On 06-May-2001, Bernard James POPE <[EMAIL PROTECTED]> wrote: > > If you applied the Mercury algorithm to Haskell (ie used fixed point iteration > to search for a type, rather than requiring a type annotation), would > the new type inference algorithm accept/reject the same programs as the > exi

Re: Polymorphic recursion

1998-11-04 Thread Fergus Henderson
On 03-Nov-1998, Mark P Jones <[EMAIL PROTECTED]> wrote: > ghc doesn't need to use an iteration limit because it subjects the input > source program to stricter limits to guarantee decidability. The release notes for ghc 4.00 mention a new `-fallow-undecidable-instances' option. I presume that it

Re: Polymorphic recursion

1998-11-04 Thread Fergus Henderson
On 03-Nov-1998, Michael Hanus <[EMAIL PROTECTED]> wrote: > Fergus Henderson wrote: > > >Is there any Haskell implementation that supports polymorphic recursion > > > without the need of annotating the types for defined function by the > > > programmer? > > > > Not as far as I know. > > > > H

RE: Polymorphic recursion

1998-11-04 Thread Simon Peyton-Jones
> I don't know whether ghc uses an iteration limit mechanism -- > my guess is that it probably uses the same technique as Hugs. No, it's an iteration limit. (When you say -fallow-undecideable-instances). Simon

RE: Polymorphic recursion

1998-11-03 Thread Mark P Jones
| I think Hugs 1.3c and recent versions of ghc both support undecideable | features in their type systems -- but related to typeclasses and | instance declarations rather than to polymorphic recursion. | | From email with Mark Jones, I gather that Hugs does not use an | iteration limit mechanism,

Re: Polymorphic recursion

1998-11-03 Thread Fergus Henderson
On 02-Nov-1998, Tomasz ?ukaszewicz <[EMAIL PROTECTED]> wrote: >Is there any Haskell implementation that supports polymorphic recursion > without the need of annotating the types for defined function by the > programmer? Not as far as I know. However, the current Mercury implementation suppor

Re: Polymorphic recursion

1998-11-03 Thread Michael Hanus
Fergus Henderson wrote: > >Is there any Haskell implementation that supports polymorphic recursion > > without the need of annotating the types for defined function by the > > programmer? > > Not as far as I know. > > However, the current Mercury implementation supports this. This sounds in

Re: Polymorphic recursion

1994-01-06 Thread Sebastian Hunt
On Thu, 6 Jan 1994, Simon L Peyton Jones wrote: > OK, here's my example. I hope it's right. I was writing a compiler > pass which looked at a data type something like > > data Expr = Let Bind Expr > | ... > > data Bind = MkBind String Expr > > Then I had three fu

Re: Polymorphic recursion

1994-01-06 Thread Simon L Peyton Jones
| From: Sebastian Hunt <[EMAIL PROTECTED]> | Date: Thu, 9 Dec 1993 16:00:13 GMT | In the interests of keeping things (ie, the haskell type system) | as simple as possible, I would vote (if I had a vote) against this | proposal. Unless, of course, I was persuaded that the extension was | Really

Re: Polymorphic recursion

1993-12-16 Thread Lennart Augustsson
> One modest extension we could make to the Haskell type system is > > to permit polymorphic recursion if > a type signature is provided I'm absolutely for this suggestion (especially since hbc already has it :-). My reason for this is that it is already possible to do this in Ha

Re: Polymorphic recursion

1993-12-10 Thread Kent Karlsson
> Dear people interested in Haskell 1.3, Disclaimer: I'm *not* a member of any "Haskell 1.3" committee, if any such committee has been formed. > One modest extension we could make to the Haskell type system is > > to permit polymorphic recursion if > a type signature is provided

Re: Polymorphic recursion

1993-12-10 Thread henglein
On the Haskell mailing list Simon writes: >PS This idea [of admitting polymorphic recursion if it's declared explicitly] >is part of the folklore, but I don't know of a reference which >describes it. Does anyone else? (Specifically the simple type-signature >solution; I know there are papers ab

Re: Polymorphic recursion

1993-12-10 Thread Nigel Perry
At 4:32 AM 10/12/93 +1300, Simon L Peyton Jones wrote: >Dear people interested in Haskell 1.3, Well... :-) >One modest extension we could make to the Haskell type system is > >to permit polymorphic recursion if >a type signature is provided > >etc. I wouldn't have even thought

Re: Polymorphic recursion

1993-12-09 Thread jones-mark
Simon's proposal seems reasonable -- I've been told that this idea is already used in Miranda and hbc (with a command line option that I don't know) so it certainly is feasible. However ... as Satish has pointed out, we need to be very careful about the interaction with overloading. In particul

Re: Polymorphic recursion

1993-12-09 Thread Mikael Rittri
> to permit polymorphic recursion if > a type signature is provided > > Simon > > PS This idea is part of the folklore, but I don't know of a reference which > describes it. Does anyone else? (Specifically the simple type-signature > solution; ...) By coincidence, I was just

Re: Polymorphic recursion

1993-12-09 Thread Satish Thatte
> From: Simon L Peyton Jones <[EMAIL PROTECTED]> > [...] > The standard Hindley-Milner restriction is that a recursive function > can only be called monomorphically in its own body. Here's an > example (from an earlier posting to the SML list, which can't typecheck > under this restriction.

Re: Polymorphic recursion

1993-12-09 Thread Sebastian Hunt
> One modest extension we could make to the Haskell type system is > > to permit polymorphic recursion if > a type signature is provided ... > This program looks a little odd, but I can personally testify to having > tripped over this problem in programs that I Really Wanted to wr

Re: Polymorphic recursion

1993-12-09 Thread Joe Fasel
I support Simon's proposal to allow explicitly typed polymorphic recursion. It is consistent with the exception to the monomorphism restriction for explicit typings. Let's get a ruling from the type wizards that the principle is sound, however, and from the implementors that it doesn't seriously