Use the Prelude function realToFrac.
-- Lennart
Mike T. Machenry wrote:
Hello,
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 st
Try
intToFloat :: Int -> Float
intToFloat n = fromInteger (toInteger n)
-W-M-
@ @
|
\_/
On Fri, 28 Feb 2003, Mike T. Machenry wrote:
> Hello,
>
> I am having a problem. I recently desided I wanted a bunch function to return
> float instead of Int. I changed their type and wro
Hello,
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 to convert Int to Float. Sadly Haskell wo
Hello!
It seems we can truly implement Monad2 without pushing the
envelope too far. The solution and a few tests are given below. In
contrast to the previous approach, here we lift the type variables
rather than bury them. The principle is to bring the type logic
programming at the level
The submission deadline for ICFP -- the International Conference on Functional
Programming -- is coming up soon: Saturday, March 29, which is four weeks away.
The 2003 ICFP will be in Uppsala, Sweden on August 25-29, in conjunction with
PPDP (Principles and Practice of Declarative Programming). Pl
> The reason, which is thoroughly explained in Simon Peyton-Jones'
> message, is that the given type signature is wrong: it should read
> f1 :: (exists b. (C Int b) => Int -> b)
Right. Simon pointed out that this is a pretty useless function, but not
entirely so, since the result of it is n
Hello.
Haskells declarativity is really useful to transform
mathematical models into data types and algorithms.
In the context of a seminary I have dealt with
equilibria concepts (especially Nash and Wardrop equilibrium)
in loss networks.
(based on "Non-cooperative routing in loss networks" by Al
> I have successfully used the the excellent haskell tools
> Happy and Alex in a
> couple of parsing projects, but I have failed when trying to
> combine a
> monadic Happy grammar (using the %monad and %lexer
> directives) together with
> an Alex generated okenizer, nor are there any such e
I have successfully used the the excellent haskell tools Happy and Alex in a
couple of parsing projects, but I have failed when trying to combine a
monadic Happy grammar (using the %monad and %lexer directives) together with
an Alex generated okenizer, nor are there any such examples in the Hap
| since this claims that it will take a Bool and produce a value of type
b
| for all types b. However, would it be all right to say (in
| pseudo-Haskell):
|
| > f :: exists b . Bool -> b
| > f x = x
But this is a singularly useless function, because it produces a result
of utterly unknown type,
10 matches
Mail list logo