def App.fold
import Base3197def App.fold(
3198 -S: Type, app: App<S>, events: List<Event>, state: S,
3199 rest: S -> IO(Maybe<S>)
3200) -> IO(Maybe<S>):
3201 App{view, tick} = app
3202 IO.bind(Maybe<S>, Maybe<S>, tick(events, state), App.more(S, rest))