I just fluffed the To: field in the header, so my previous
message was bounced, I'm resending this ... sorry if it
turns up twice. (I also took the opportunity to make an addendum).
Yo,
Haskell Integers are not a proper subset of Haskell Floats or
Doubles. Haskell does not support real
I agree with what you said,
but I think you may have missed my point.
Sounds likely on both counts.
The same thing annoys me, but my work is in exact or symbolic:
-- I don't claim this is a practical example
-- I'm just saying that it is logically plausible
denominator 2 % 3 == 3
G'day all.
On Mon, Mar 03, 2003 at 12:10:28PM -0500, Matthew Donadio wrote:
This is my biggest gripe with Haskell, at least for what I do. The
numeric class system is good, but it assumes that the sub-classes are
distict, where in fact integers are a proper subset of reals, which
are a
Mike T. Machenry [EMAIL PROTECTED] writes:
I am having a problem. I recently desided I wanted a bunch function to return
float instead of Int. I changed their type and wrote a new function that
returned a float. I figured it'd be okay if all the others still returned
Int since it's trivial
Thank does sound like a pain, but it's better than putting fromIntegral
all over my code. Why can't Haskell unify a an expected float with an
infered int? It seems that this would make life alot easier.
-mike
On Sun, Mar 02, 2003 at 11:28:00AM +, Jorge Adriano wrote:
Mike T. Machenry
Matthew Donadio [EMAIL PROTECTED] writes:
Thank does sound like a pain, but it's better than putting fromIntegral
all over my code. Why can't Haskell unify a an expected float with an
infered int? It seems that this would make life alot easier.
Personally, I think that one of the things that
Mike T. Machenry [EMAIL PROTECTED] writes:
I recently desided I wanted a bunch function to return
float instead of Int. [...] I found fromInteger but it
didn't seem to work on the return value of the cardinality
function for instance.
Try fromIntegral, which works for Int and Integer,
Hello,
[snip]
Try
intToFloat :: Int - Float
intToFloat n = fromInteger (toInteger n)
[snip]
Use the Prelude function realToFrac.
it sometimes happens to me that I must spend some time browsing
prelude to devise somethink like this; it might be useful to have
a library for this, that would
Mike T. Machenry [EMAIL PROTECTED] writes:
I recently desided I wanted a bunch function to return
float instead of Int. [...] I found fromInteger but it
didn't seem to work on the return value of the cardinality
function for instance.
Try fromIntegral, which works for Int and Integer, too.