[Haskell-cafe] noob question

Ben thefunkslists at gmail.com
Mon Feb 25 19:01:43 EST 2008

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

But this doesn't

*Main> (\k -> (1/k) ^ k) 3

     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  

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080225/c074ee50/attachment.htm

More information about the Haskell-Cafe mailing list