Skip to content

Instantly share code, notes, and snippets.

@lu4nm3
Last active May 14, 2020 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lu4nm3/f65a19f08b4ddcbb3cba3205bd906fdc to your computer and use it in GitHub Desktop.
Save lu4nm3/f65a19f08b4ddcbb3cba3205bd906fdc to your computer and use it in GitHub Desktop.
def program(R: MonadReader[IO, Config]): IO[Unit] = {
for {
status <- R.reader(getJobStatus)
_ <- R.reader(sendAlert(status))
} yield ()
}
createMonadReader(Config("127.0.0.1:8080")).flatMap(readerMonad => program(readerMonad)) // IO[Unit]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment