[Haskell-cafe] Learn You a Haskell for Great Good - a few doubts
Karthick Gururaj
karthick.gururaj at gmail.com
Fri Mar 4 05:49:26 CET 2011
There are so many responses, that I do not know where to start..
I'm top-posting since that seems best here, let me know if there are
group guidelines against that.
Some clarifications in order on my original post:
a. I ASSUMED that '()' refers to tuples, where we have atleast a pair.
This is from my Haskell ignorance, so let us forget that for now.
b. Also, when I said: tuples can not be ordered, let alone be enum'd -
I meant: there is no reasonable way of ordering tuples, let alone enum
them.
That does not mean we can't define them:
1. (a,b) > (c,d) if a>c
2. (a,b) > (c,d) if b>d
3. (a,b) > (c,d) if a^2 + b^2 > c^2 + d^2
4. (a,b) > (c,d) if a*b > c*d
If we can imagine (a,b) as a point in the xy plane, (1) defines
ordering based on which point is "more to the right of y axis", (2)
based on "which point is more above x axis", (3) on "which point is
farther from origin" and (4) on "which rectangle made of origin and
the point as diagonally opposite vertices has more area". Which of
these is a reasonable definition? The set of complex numbers do not
have a "default" ordering, due to this very issue.
For enumerating them, we *can* go along the diagonal as suggested. But
why that and not something else? By the way - enumerating them along
the diagonal introduces a new ordering between tuples.
When we do not have a "reasonable" way of ordering, I'd argue to not
have anything at all - let the user decide based on his/her
application of the tuple.
As a side note, the cardinality of rational numbers is the same as
those of integers - so both are "equally" infinite.
Regards,
Karthick
On Fri, Mar 4, 2011 at 8:42 AM, Daniel Fischer
<daniel.is.fischer at googlemail.com> wrote:
> On Friday 04 March 2011 03:24:34, Markus wrote:
>> What about having the order by diagonals, like:
>>
>> 0 1 3
>> 2 4
>> 5
>>
>> and have none of the pair be bounded?
>>
>
> I tacitly assumed product order (lexicographic order).
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
More information about the Haskell-Cafe
mailing list