Fwd: [Haskell-cafe] A simple question

Marc Charpentier mc at 3virgule14.net
Wed Nov 3 07:06:49 EST 2004

Thank you all for the friendly and helpful explanations - and for your 

The solution to my problem is finally

		f :: Double -> Double
		f i = (-1)**i/(2**(10*i)) * (-2^5/(4*i+1)-1/(4*i+3)+2^8/(10*i+1) 
I had confused (^) and (**) due the fact that
are accepted.

The important sentence in the Gentle Tutorial is

	" It is easy to forget at times that numerals are overloaded, and not 
implicitly coerced to the various numeric types,"

(Finding my errors was made somewhat difficult due to the following 
messages I got while testing my conjectures:

*Main> let i=1  in 1/2^i
*Main> let i=1  in i/2^i

Ambiguous type variable `a' in these top-level constraints:
   `Fractional a' arising from use of `/' at <interactive>:1
   `Integral a' arising from use of `^' at <interactive>:1



Thanks to all.

Marc Charpentier

More information about the Haskell-Cafe mailing list