Hi,
I am doing an exercise in Haskell, which is converting a string like “$123.312” to double value. Below is my code:

module Main where
    import Data.Char

    caluInt l = foldl1 (\acc x -> acc * 10 + x) (map digitToInt l)
    caluDecimal l = (foldr1 (\x acc -> acc / 10.0 + x) (map digitToInt l))

    convert(x:xs) = 
        let num = [e | e <- xs, e /= ',']
            intPart = takeWhile (/='.') num
            decimalPart = tail(dropWhile (/='.') num)
        in (caluInt intPart) + (caluDecimal decimalPart)

And I got an error in this line:     caluDecimal l = (foldr1 (\x acc -> acc / 10.0 + x) (map digitToInt l)),
which says:

    No instance for (Fractional Int) arising from a use of `/'

    Possible fix: add an instance declaration for (Fractional Int)

    In the first argument of `(+)', namely `acc / 10.0'

    In the expression: acc / 10.0 + x

    In the first argument of `foldr1', namely

      `(\ x acc -> acc / 10.0 + x)'


Why Haskell insists that 10.0 is a Int? How can I explicitly tell Haskell I want a Fractional?
-- 
Cui Liqiang