* @return the new state
*/
public static TGlobal runSTIO(Lazy action, TGlobal g) {
Lambda stg = Delayed.<Lambda>forced(action); // StateT (g -> IO (a, g))
Lambda r = Delayed.<Lambda>forced( TStateT.run(stg, g));
TTuple2 t = r.apply(42).result().<TTuple2>forced();
return Delayed.<TGlobal>forced(t.mem2);
}
/**
* Run a {@link frege.prelude.PreludeBase.TState} action and return the result.