http://kodt-rsdn.livejournal.com/ ([identity profile] kodt-rsdn.livejournal.com) wrote in [personal profile] deniok 2016-03-07 07:44 pm (UTC)

А length0 - она вообще энергичная?
Там не может получиться, что компилятор построит мега-санки I# (...(((0# +# 1#) +# 1#) + 1#)...), которые влезли в память (в отличие от length''' только потому, что боксированные данные занимают вдвое больше места)?

Как насчёт заведомо энергичного
length00 = I# . foldl' (const . inc) 0# where inc h = h +# 1#

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting