I'm using the stuff provided here by @DavidYoung. I have a function:
hypergeom ::
forall a. (Eq a, Fractional a, BaseFrac a)
=> Int -- truncation weight
-> BaseFracType a -- alpha parameter (usually 2)
-> [a] -- "upper" parameters
-> [a] -- "lower" parameters
-> [a] -- variables (the eigenvalues)
-> IO a
But when I run it with a = Complex Rational I get this error:
No instance for (RealFloat (Ratio Integer))
arising from a use of `hypergeom'
What does that mean?
More precisely, here is the command I run:
ghci> import Data.Ratio
ghci> import Data.Complex
ghci> alpha = 2 % 1 :: Rational
ghci> a = 2 % 10 :+ 1 % 1 :: Complex Rational
ghci> b = 1 % 2 :+ 0 % 1 :: Complex Rational
ghci> c = 2 % 1 :+ 3 % 1 :: Complex Rational
ghci> x1 = 1 % 3 :+ 1 % 4 :: Complex Rational
ghci> x2 = 1 % 5 :+ 1 % 6 :: Complex Rational
ghci> hypergeom 10 alpha [a, b] [c] [x1, x2]
<interactive>:28:1: error:
* No instance for (RealFloat (Ratio Integer))
arising from a use of `hypergeom'
* In the expression: hypergeom 10 alpha [a, b] [c] [x1, x2]
In an equation for `it':
it = hypergeom 10 alpha [a, b] [c] [x1, x2]
I'm pretty sure this worked in the past but I used Data.Complex.Generic (I don't use it anymore because it's not possible with a recent resolver).