gen_fun: add constructor for generating function with no variables