PROPOSAL: Restrict the type of (^), (^^), and add genericPower, genericPower'

David Benbennick dbenbenn at gmail.com
Sat Nov 17 17:46:56 EST 2007


I thought of two more reasons I'm against this proposal:

2) It isn't backwards compatible.  It will cause some existing Haskell
code to not compile.

3) It makes things more difficult in GHCI.  Under this proposal, you'd
have the following:

Prelude> let x = 2
Prelude> 6 ^ x
<interactive>:
    Couldn't match expected type `Int' against inferred type `Integer'


On 11/17/07, Henning Thielemann <lemming at henning-thielemann.de> wrote:
> Let me guess - you don't use -Wall. :-) Warnings are not the problem,
> warnings point to a problem. The problem here is, that the compiler has to
> guess a type, because it cannot be infered from other operands.

I don't see how that's a problem.  Have you ever had a case where
defaulting to Integer produced the wrong behavior?


More information about the Libraries mailing list