[Haskell-beginners] beginner's type error
Brent Yorgey
byorgey at seas.upenn.edu
Sat Mar 28 08:29:47 EDT 2009
On Fri, Mar 27, 2009 at 11:28:54AM -0400, Edward Z. Yang wrote:
> On Fri, 27 Mar 2009, Brent Yorgey wrote:
>>> thing n = n + fromIntegral (round (sqrt n))
>
> thing :: Floating a => a -> a
>
>>> thing n = n + round (sqrt (fromIntegral n))
>
> thing :: Integral a => a -> a
>
> That is, the return types of the method are different?
Right!
-Brent
More information about the Beginners
mailing list