Re: [Haskell-cafe] Are arbitrary rank types and existentials equivalent?

2008-11-10 Thread Henning Thielemann
Ryan Ingram schrieb: There's a natural relation between higher rank types and existentials; one way to think about it is this: if you have some existential type t (subject to some constraints), you cannot operate on it except with some function that accepts any type t subject to those

[Haskell-cafe] Are arbitrary rank types and existentials equivalent?

2008-11-09 Thread Loup Vaillant
Maybe one subsumes the other? What I want to know is if there is an easy way to emulate one with the other, and how much convenience is lost in doing so. For instance, is it possible to implement stream fusion with rank2 types, or the ST monad with existantials? Is there any paper discussing

Re: [Haskell-cafe] Are arbitrary rank types and existentials equivalent?

2008-11-09 Thread Loup Vaillant
Thank you, everyone. You have addressed my concerns very accurately. So in short, higer rank types subsume existentials. Good. And the burden of emulating existentials can be lowered by a suitable macro system. Very good. 2008/11/9 Derek Elkins [EMAIL PROTECTED]: There are various rules for

Re: [Haskell-cafe] Are arbitrary rank types and existentials equivalent?

2008-11-09 Thread Derek Elkins
On Sun, 2008-11-09 at 13:46 +0100, Loup Vaillant wrote: Maybe one subsumes the other? What I want to know is if there is an easy way to emulate one with the other, and how much convenience is lost in doing so. For instance, is it possible to implement stream fusion with rank2 types, or

Re: [Haskell-cafe] Are arbitrary rank types and existentials equivalent?

2008-11-09 Thread Ryan Ingram
There's a natural relation between higher rank types and existentials; one way to think about it is this: if you have some existential type t (subject to some constraints), you cannot operate on it except with some function that accepts any type t subject to those constraints. There is a simple