Re: [Haskell-cafe] tuples and Show in GHC

2005-03-07 Thread John Meacham
On Mon, Mar 07, 2005 at 03:54:07PM +, Keean Schupke wrote: > >Which almost sounds like a hint to replace the current tuples by > >HLists in Haskell 2? ;) > > > >Something like: > > > >infixr 5 :*: > >data HNil = HNil > >data HList b => a :*: b = a :*: !b deriving (Eq, Ord) > > > >-- type () = H

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread John Meacham
On Mon, Mar 07, 2005 at 08:47:11PM +0100, Daniel Fischer wrote: > And, BTW, that's why Keean et al's HList library doesn't help here either, > the > type of an HList determines the number of elements and the type of each, so > there we face the same problems as with nested tuples. What we need i

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Greg Buchholz
Daniel Fischer wrote: > I think, it would be possible to define recursion combinators for specific > patterns, like this functions takes 4 elements from the stack, this one 3 and > so on, but then you would need combinators for all these patterns, which is > rather cumbersome. Hmm. The sta

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Keean Schupke
Daniel Fischer wrote: And, BTW, that's why Keean et al's HList library doesn't help here either, the type of an HList determines the number of elements and the type of each, so there we face the same problems as with nested tuples. What we need is type Stack = [ArbitraryType] (from the HList pap

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Daniel Fischer
Am Montag, 7. März 2005 17:58 schrieb Greg Buchholz: > Daniel Fischer wrote: > > Am Freitag, 4. März 2005 19:35 schrieb Greg Buchholz: > > > So, can anyone direct me towards more information on exactly > > > what an "Occurs check" is, or does anyone see an easy fix to my > > > problems? > > > > If

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Greg Buchholz
Daniel Fischer wrote: > Am Freitag, 4. M?rz 2005 19:35 schrieb Greg Buchholz: > > So, can anyone direct me towards more information on exactly > > what an "Occurs check" is, or does anyone see an easy fix to my > > problems? > > If I remember correctly, an "occurs check" is checking whether a type

Re: [Haskell-cafe] tuples and Show in GHC

2005-03-07 Thread Keean Schupke
Remi Turk wrote: On Mon, Mar 07, 2005 at 12:05:41AM +, Keean Schupke wrote: Daniel Fischer wrote: The Show instances for tuples aren't automatically derived, they are defined in GHC.Show. So somewhere there must be an end, probably the author(s) thought that larger tuples than quintup

Re: [Haskell-cafe] tuples and Show in GHC

2005-03-07 Thread Remi Turk
On Mon, Mar 07, 2005 at 12:05:41AM +, Keean Schupke wrote: > Daniel Fischer wrote: > > >The Show instances for tuples aren't automatically derived, they are > >defined in GHC.Show. So somewhere there must be an end, probably the > >author(s) thought that larger tuples than quintuples aren't

RE: [Haskell-cafe] tuples and Show in GHC

2005-03-07 Thread Simon Peyton-Jones
No principled reason. I wish there was no limit, which would involve generating code on the fly for instances that weren't pre-generated, but I never got around to implementing that. So you have to stop somewhere. Actually the Report says it should have Show instances up to 15 at least, but GHC d