Simon Peyton Jones wrote: > 3. I'm more concerned about the programmer than the implementation. > Consider > (f,g) = (negate, show) > What type do you expect 'f' to have? A straightforward answer might be > f :: (Num a, Show b) => a -> a > If you don't want that, you need to explain a more complicated typing > rule for pattern bindings. I'll ask the same about > (f,g) = (reverse, length) > A simple and consistent story is that all the pattern bound variables > are generalised over all the class constraints and all the type > variables of the RHS. But I bet that is not what you want.
I think this is reasonable. In general, something of type (Num a, Show b) => (a -> a, b -> String), might have an occurrence of b hidden inside a -> a. I wouldn't expect specific expressions of this type to be given special treatment. Cheers, Ganesh ============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html ============================================================================== _______________________________________________ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime