
20 Mar
2009
20 Mar
'09
8:14 p.m.
On 2009 Mar 20, at 20:07, Zachary Turner wrote:
2009/3/20 Brandon S. Allbery KF8NH
...but there is (%) :: (Integral a) => a -> a -> Ratio a Prelude Data.Ratio> let y = truncate (x%3) Prelude Data.Ratio> :t y y :: Integer
Why does y now have the type Integer instead of Int?
Because of the monomorphism restriction and defaulting. Actually use it somewhere and it will take the appropriate (Integral) type. -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH