Re: [Haskell-cafe] Re: Wikipedia on first-class object

How can I test that partial order in Haskell ?
You can't. It's kinda internal. More specifically, if you try to compute a value, which is not maximal in this order, you'll get an error or loop forever. But you still can use such values in your programs if you don't try to compute them. The point is, maximal values are the only interesting ones, and all others are just approximations. In fact, you only have to worry about non-maximal values when you use recursion. The fundamental property of Haskell is that it computes the least fixed point. For example, if f maps (_|_) to (_|_), then "let x = f x in x" will evaluate to (_|_) - and you loop forever, see above.

Thank you.
It sounds like a limit. xn --> x for n --> :-)
How can I get that maximal value when I start from a non maximal one ?
[1 .. ] and x=1:x are maximal ?
On Fri, 28 Dec 2007 11:21:36 +0200, Miguel Mitrofanov
How can I test that partial order in Haskell ?
You can't. It's kinda internal. More specifically, if you try to compute a value, which is not maximal in this order, you'll get an error or loop forever. But you still can use such values in your programs if you don't try to compute them. The point is, maximal values are the only interesting ones, and all others are just approximations.
In fact, you only have to worry about non-maximal values when you use recursion. The fundamental property of Haskell is that it computes the least fixed point. For example, if f maps (_|_) to (_|_), then "let x = f x in x" will evaluate to (_|_) - and you loop forever, see above.
________ Information from NOD32 ________ This message was checked by NOD32 Antivirus System for Linux Mail Servers. part000.txt - is OK http://www.eset.com

On 28 Dec 2007, at 3:37 AM, Cristian Baboi wrote:
Thank you.
It sounds like a limit. xn --> x for n --> :-)
I could say that LUBs are colimits, not limits, but I won't :) More seriously, I don't like the calculus --> notation in this context; these are suprema, not lims.
How can I get that maximal value when I start from a non maximal one ?
Take the least upper bound of a maximum set.
[1 .. ] and x=1:x are maximal ?
Yes. jcc

On 28/12/2007, at 4:21 PM, Miguel Mitrofanov wrote:
How can I test that partial order in Haskell ?
You can't. It's kinda internal. More specifically, if you try to compute a value, which is not maximal in this order, you'll get an error or loop forever. But you still can use such values in your programs if you don't try to compute them. The point is, maximal values are the only interesting ones, and all others are just approximations.
Right, so when I say to GHCi: Prelude> take 5 [1..] and it says: [1,2,3,4,5] then it really has computed the entirety of the infinite sequence [1..], and not some approximation? Perhaps it is better to say that in a lazy language both approximations and maximal values (least upper bounds of a chain) are interesting. In a strict language we only get our hands on the latter. The "take lemma" nicely captures this kind of thinking. (Ask google about the generalised take lemma, it's a nice paper.) Also note that the notion of equality that's being thrown around is "observational equality", i.e. "x=y" implies that for all contexts (some expression with a suitably-typed hole), if you plug 'x' into the hole, and 'y' into hole, then those two expressions denote the same value. ((Roughly) equivalently, you can use the idea of Leibniz equality: there is no function that distinguishes them. These notions may diverge in Haskell - does anyone know?) As Lennart observed, any (semi-)computable equality predicate is not going to be that strong. cheers peter
participants (4)
-
Cristian Baboi
-
Jonathan Cast
-
Miguel Mitrofanov
-
Peter Gammie