Skip to content

Instantly share code, notes, and snippets.

@taylorleese
Created June 4, 2012 20:35
Show Gist options
  • Save taylorleese/2870713 to your computer and use it in GitHub Desktop.
Save taylorleese/2870713 to your computer and use it in GitHub Desktop.
Airbrake Example IO
def notifySync(notice: AirbrakeNotice): Validation[Throwable, Int] = {
notify(prepareRequest(notice)).unsafePerformIO
}
def notify(xml: NodeSeq): IO[Validation[Throwable, Int]] = {
sendNotification(xml).map(_.success[Throwable]).except(_.fail[Int].pure[IO])
}
def sendNotification(xml: NodeSeq): IO[Int] = io {
. . .
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment