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 semThunkGen {A} (f : unit -> G A) :
semGen (thunkGen f) <--> semGen (f tt).