On Thu, Apr 11, 2013 at 12:56:05AM +0100, Barak A. Pearlmutter wrote:
> > ... in most of the cases I do want this warnings. It's possible to get
> > something default to Integer when it should be Int. There are only few
> > cases when it's not appropriate. Only ^ and ^^ with literals I think
> 
> There are a few other cases, albeit less annoying.  Like this:
> 
> c = fromIntegral 2 :: Int
> 
> Granted this is silly code, but the same case arises inside pretty much
> any code that is generic over Integral, in which case the warning you
> get is not the *right* warning.  Example:
> 
> genericTake n xs = take (fromIntegral n) xs
> genericTake 444444444444444444444444444444 "foobar"

Hi Barak,

I don't write a lot of numeric code so I am under-educated in this area.
Could you write a more substantial example so I get a clearer idea of what's
going on?

Thanks,

Tom

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to