Skip to content

Instantly share code, notes, and snippets.

@monkey-codes
Created June 9, 2023 23:29
Show Gist options
  • Select an option

  • Save monkey-codes/c900782be9ada7264e10b8ed53968450 to your computer and use it in GitHub Desktop.

Select an option

Save monkey-codes/c900782be9ada7264e10b8ed53968450 to your computer and use it in GitHub Desktop.
Screen IO monad
object Screen {
...
fun io(programState: ProgramState): IO<ProgramState> =
Suspend { generate(programState) }
.flatMap { IOs.stdout(it).map { programState.toMostRecentValidState() }}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment