rewrite using a general purpose lazy evaluation primitive