I'm just starting to learn Haskell, and I'm having some confusion (I
think) with how the type inference is working. Can someone explain
why, in ghc 6.8.2 this works:
*Main> (1/3)^3
3.7037037037037035e-2
But this doesn't
*Main> (\k -> (1/k) ^ k) 3
<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)
TIA,
Ben
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe