
26 Feb
2008
26 Feb
'08
2:35 a.m.
On Tue, 26 Feb 2008, Philippa Cowderoy wrote:
On Mon, 25 Feb 2008, Ben wrote:
<interactive>:1:8: Ambiguous type variable `t' in the constraints: `Fractional t' arising from a use of `/' at <interactive>:1:8-10 `Integral t' arising from a use of `^' at <interactive>:1:7-15 Probable fix: add a type signature that fixes these type variable(s)
/ doesn't do integer division, so from there it concludes that you're working with a Fractional type - Haskell never coerces behind your back, so not only the result of / but also its parameters are Fractional.
^ only works for Integral types. You might consider that a little arbitrary, but hey - it's mostly like that because it's much easier to raise something to an integer power.