| | 181 | |
| | 182 | == Proposal 4 - remove defaulting == |
| | 183 | It is generally agreed that defaulting, in its current form at least, is a wart on the language. The main motivation behind it is to make simple calculator-like uses of interactive Haskell environments possible. |
| | 184 | |
| | 185 | This proposal, then, is to remove defaulting from the language; we would expect that interactive environments will continue to default as they think best. Note that implementations already go beyond what is stated in the report when defaulting. |
| | 186 | |
| | 187 | Most(?) instances of defaulting in Real Programs are due to (!^). If this proposal is adopted then we would recommend changing the type of (!^) and introducing genericPower (or some better name) thus: |
| | 188 | {{{ |
| | 189 | (^) :: (Num a) => a -> Int -> a |
| | 190 | genericPower :: (Num a, Integral b) => a -> b -> a |
| | 191 | }}} |
| | 192 | This is similar to the scheme used by, for example, genericIndex. |
| | 193 | |
| | 194 | === Pros === |
| | 195 | * Easy to implement and explain. |
| | 196 | * Makes the language smaller. |
| | 197 | * Trivially fixes any problems tools like hat have with defaulting. |
| | 198 | |
| | 199 | === Cons === |
| | 200 | * No pretense at trying to remain compatible with Haskell '98, but how many uses of defaulting are there in the wild? And how many not covered by (!^)? |