Q:

Ambiguity of types in Haskell

_foldr :: (a -> b -> b) -> b -> [a] -> b  
_foldr op z [] = z
_foldr op z (x:xs) = x  `op` _foldr op z xs

Hi, let's consider above code. 
After:
ghci> _foldr + 0 [1]

I got error:
   No instance for (Num t0) arising from the literal `1'
    The type variable `t0' is ambiguous
    Possible fix: add a type signature that fixes these type variable(s)
    Note: there are several potential instances:
      instance Num Double -- Defined in `GHC.Float'
      instance Num Float -- Defined in `GHC.Float'
      instance Integral a => Num (GHC.Real. Ratio a)
        -- Defined in `GHC.Real'
      ...plus three others

Basically I understand  what it means and I suppose that changing of signature of function can repair that.  
But, I don't want change a signature.  How to solve it in another way? 

A:

Regardless of whether your _foldr method does what you want, you can fix the issue in the question (no instance for (Num t0)), not by changing the signature of your function (you're right, this function can stay polymorphic), but by specifying what type you want to use for the call in GHCi.  GHCi doesn't know what Num type you want when you typed 1; do you want integers, or double?  So you can annotate the 1 with a type to indicate, something like
_foldr (+) 0 [1::Int]

To work with Ints, for example.