So im trying to make a recursive simple interest function and i cant for the life of me figure out what type signature i need to use. Here is my code:
interest :: (Fractional a) => a-> a-> a-> a
interest p r 0 = p
interest p r t = (1 + (p/100))*interest p r (t-1)
this code gives me the error "Could not deduce (Eq a) arising from the literal `0' from the context: Fractional a bound by the type signature for: interest :: forall a. Fractional a => a -> a -> a -> a "
but when I try changing the constraint to (Eq a) it tells me "possible fix (Fractional a)
can someone help me out?