Re: monomorphism etc.

1998-11-13 Thread Fergus Henderson
On 12-Nov-1998, Lennart Augustsson [EMAIL PROTECTED] wrote: [...] if you dislike tuples you can use nested pairs At the cost of losing a little type-safety. -- Fergus Henderson [EMAIL PROTECTED] | "Binaries may die WWW: http://www.cs.mu.oz.au/~fjh | but source code lives forever" PGP:

Re: monomorphism etc.

1998-11-12 Thread Lennart Augustsson
I think it would be really nice if it were possible to create a container capable of containing any number of objects of any number of types It would That's not possible in Haskell. Since you want an any number of different types in this new type it would need to have a variable number

Re: monomorphism etc.

1998-11-12 Thread Lennart Augustsson
[...] if you dislike tuples you can use nested pairs At the cost of losing a little type-safety. That's really a very minimal loss. (And it's not really a loss of type safety, just the possibilty of confusing a part of a "tuple" with another "tuple"). I'd be more worried about the

nested pairs (was Re: monomorphism etc.)

1998-11-12 Thread Claus Reinke
But if you dislike tuples you can use nested pairs, like infixr 0 :. data T a b = a :. b Now you can write 'a' :. True :. "Hello" :. () which has type T Char (T Bool (T String ())) But I guess that's not what you were after? -- Lennart Fergus replied: [...] if you dislike

Re: nested pairs (was Re: monomorphism etc.)

1998-11-12 Thread Claus Reinke
PS. I've got a length function for ``heterogeneous lists'', as they appear in nested pairs, in Hugs. However, it uses the type system extensions available in 1.3c or in 1.4 [98 BETA]. How much can you do in plain Haskell??? in Cayenne?-) oops. On second thought, this length

monomorphism etc.

1998-11-11 Thread David Feuer
I tried and failed to understand the reasons given in the Report (1.4) for the monomorphism restriction and other type things. Could someone explain what these mean and why they are needed? I think it would be really nice if it were possible to create a container capable of containing any number