Re: learning to love laziness

2003-09-26 Thread Derek Elkins
On Thu, 25 Sep 2003 12:59:37 -0700 Mark Tullsen [EMAIL PROTECTED] wrote: Haskell has lazy/lifted products and not true products. Aren't lazy products true products? What makes something a product is: fst (x,y) = x snd (x,y) = y for all x and y. This holds with lazy products but not eager

Re: learning to love laziness

2003-09-26 Thread John Hughes
On Fri, 26 Sep 2003, Derek Elkins wrote: On Thu, 25 Sep 2003 12:59:37 -0700 Mark Tullsen [EMAIL PROTECTED] wrote: Haskell has lazy/lifted products and not true products. Aren't lazy products true products? What makes something a product is: fst (x,y) = x snd (x,y) = y for all x and y.

Re: learning to love laziness

2003-09-25 Thread Mark Tullsen
Haskell has lazy/lifted products and not true products. This feature is considered by many to be an unfortunate aspect of Haskell. A 2-tuple is just syntactic sugar for data Tuple2 a b = Tuple2 a b Maybe from seeing this, it's clearer why laws such as x = (fst x,snd x) do not hold. Neither

learning to love laziness

2003-09-24 Thread Norman Ramsey
Consider the following Haskell function: asPair x = (fst x, snd x) This function has type forall a b. (a, b) - (a, b) and is almost equivalent to the identity function, except it can be used to make programs terminate that might otherwise fall into a black hole. My students are extremely

Re: learning to love laziness

2003-09-24 Thread Richard Nathan Linger
On Wed, 24 Sep 2003, Norman Ramsey wrote: Consider the following Haskell function: asPair x = (fst x, snd x) This function has type forall a b. (a, b) - (a, b) and is almost equivalent to the identity function, except it can be used to make programs terminate that might otherwise fall

Re: learning to love laziness

2003-09-24 Thread Iavor Diatchki
hello, Richard Nathan Linger wrote: On Wed, 24 Sep 2003, Norman Ramsey wrote: Consider the following Haskell function: asPair x = (fst x, snd x) This function has type forall a b. (a, b) - (a, b) and is almost equivalent to the identity function, except it can be used to make programs