[Haskell-cafe] Set of reals...?
Graham Klyne
GK at ninebynine.org
Wed Oct 27 04:51:29 EDT 2004
I think the first question you have to address is whether you really want
to represent a *set* of reals or an *interval* of reals. Then, some other
questions follow:
- possibly infinite sets within any given interval?
- open or closed intervals?
and probably more.
#g
--
At 16:56 27/10/04 +0900, Stijn De Saeger wrote:
>Hi all,
>
>I'm new to this list, as well as to haskell, so this question probably
>has "newbie" written all over it.
>I'm thinking of a way to represent a set of reals, say the reals
>between 0.0 and 1.0. Right now I am just using a pair of Float to
>represent the lower and upper bounds of the set, but i have this dark
>throbbing feeling that there should be a more haskellish way to do
>this, using laziness.
>List comprehensions are out it seems, because they increment with
>integer steps... (obviously). In other words, 0.5 `inSet` (Set
>[0.0..1.0]) returns False.
>
>I'm sure someone must have hit this problem before me and found a way
>around it.
>any suggestions greatly appreciated,
>
>regards,
>stijn.
>_______________________________________________
>Haskell-Cafe mailing list
>Haskell-Cafe at haskell.org
>http://www.haskell.org/mailman/listinfo/haskell-cafe
------------
Graham Klyne
For email:
http://www.ninebynine.org/#Contact
More information about the Haskell-Cafe
mailing list