
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Jun 17, 2010, at 12:35 , Roman Cheplyaka wrote:
That's exactly what I'm asking about. 'abs' in C does not require any allocations, does it? So why does it require any allocations in Haskell, assuming we've got no lazyness, typeclass indirection (I assume 'abs' was specialized and inlined) or other high-level features in resulted low-level code?
Quite a few obvious specializations / rules are missing; you can propose them. Answering your question about the implementation of abs, my guess is that the current definition works for every type (I'm pretty sure C doesn't know what to do with a Data.Ratio). - -- 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 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.10 (Darwin) iEYEARECAAYFAkwacCwACgkQIn7hlCsL25XS/wCgvZWVoxZLrIlNywg4ZLA6tEwW UpEAnjTLW5E5EHYcOIu0Eq1Rclh2wxfR =BFE2 -----END PGP SIGNATURE-----