
"Cale Gibbard"
On 17/11/2007, Ian Lynagh
wrote: In my opinion, (^) has the wrong type. Just as we have, for example, (!!) :: [a] -> Int -> a genericIndex :: (Integral b) => [a] -> b -> a we should also have (^) :: (Num a) => a -> Int -> a genericPower :: (Num a, Integral b) => a -> b -> a (or some other function name). The same goes for (^^) (genericPower').
This is a move in the opposite direction from what I'd really like to see. The Int type is usually a premature optimisation,
Hear, hear.
I would much prefer for length, !!, etc. to have more general types, not less general (with compiler specialisation on Int of course).
This change would be annoying.
Agreed. -- Jón Fairbairn Jon.Fairbairn@cl.cam.ac.uk