Instance Functor_G : Functor G := {
fmap A B := fmap;
}.
Instance Applicative_G : Applicative G := {
pure A := returnGen;
ap A B := apGen;
}.
Instance Monad_G : Monad G := {
ret A := returnGen;
bind A B := bindGen;
}.
Definition thunkGen {A} (f : unit -> G A) : G A :=
MkGen (fun n r => run (f tt) n r).

Lemma semThunkGenSize {A} (f : unit -> G A) s :
semGenSize (thunkGen f) s <--> semGenSize (f tt) s.