asInt using foldl'