Re: [Haskell] Fixpoint combinator without recursion

2007-04-05 Thread Claus Reinke
Then we say "the argument occurs in both positive and negative positions" or "the argument occurs in both covariant and contravariant positions". There doesn't seem to be a shorter name. I want to note that this kind of thing drives OOP crazy. i recall this paper being of some help:-) http:/

Re: [Haskell] Fixpoint combinator without recursion

2007-04-05 Thread Stefan O'Rear
On Thu, Apr 05, 2007 at 06:26:17PM -0300, Felipe Almeida Lessa wrote: > I know that types like > > >data T = T (T -> T) > > are inhabitated by things other than bottom (like id or \_ -> > undefined), but can it be useful for *anything*? Yes. In particular, types like those can produce an explic

Re: [Haskell] Fixpoint combinator without recursion

2007-04-05 Thread Felipe Almeida Lessa
On 4/5/07, Albert Y. C. Lai <[EMAIL PROTECTED]> wrote: Dan Weston wrote: > What is it called if it's both? Then we say "the argument occurs in both positive and negative positions" or "the argument occurs in both covariant and contravariant positions". There doesn't seem to be a shorter name. I

Re: [Haskell] Fixpoint combinator without recursion

2007-04-05 Thread Albert Y. C. Lai
Dan Weston wrote: What is it called if it's both? Then we say "the argument occurs in both positive and negative positions" or "the argument occurs in both covariant and contravariant positions". There doesn't seem to be a shorter name. I want to note that this kind of thing drives OOP crazy

Re: [Haskell] Fixpoint combinator without recursion

2007-04-04 Thread Edsko de Vries
On Wed, Apr 04, 2007 at 02:57:06PM -0700, Dan Weston wrote: > What is it called if it's both? Is this even legal in Haskell? It seems > as though this would not be a grounded type, going on forever in both > directions. I guess "negative datatype" is being a bit loose with terminology; the funct

Re: [Haskell] Fixpoint combinator without recursion

2007-04-04 Thread Dan Weston
What is it called if it's both? Is this even legal in Haskell? It seems as though this would not be a grounded type, going on forever in both directions. Dan Stefan O'Rear wrote: On Wed, Apr 04, 2007 at 01:36:18PM -0700, Michael Vanier wrote: For those of us who aren't type theorists: What's

Re: [Haskell] Fixpoint combinator without recursion

2007-04-04 Thread Stefan O'Rear
On Wed, Apr 04, 2007 at 01:36:18PM -0700, Michael Vanier wrote: > For those of us who aren't type theorists: What's a "negative datatype"? Negative isn't the usual term; we mostly call them 'contravariantly recursive' data types, due to CT influence. Anyways the thing to note is that the value ap

Re: [Haskell] Fixpoint combinator without recursion

2007-04-04 Thread Michael Vanier
For those of us who aren't type theorists: What's a "negative datatype"? Mike Edsko de Vries wrote: Hey, It is well-known that negative datatypes can be used to encode recursion, without actually explicitly using recursion. As a little exercise, I set out to define the fixpoint combinator usin

Re: [Haskell] Fixpoint combinator without recursion

2007-04-04 Thread Stefan O'Rear
On Wed, Apr 04, 2007 at 07:39:24PM +0100, Edsko de Vries wrote: > Hey, > > It is well-known that negative datatypes can be used to encode > recursion, without actually explicitly using recursion. As a little > exercise, I set out to define the fixpoint combinator using negative > datatypes. I thin

[Haskell] Fixpoint combinator without recursion

2007-04-04 Thread Edsko de Vries
Hey, It is well-known that negative datatypes can be used to encode recursion, without actually explicitly using recursion. As a little exercise, I set out to define the fixpoint combinator using negative datatypes. I think the result is kinda cool :) Comments are welcome :) Edsko {- Def