Skip to content

Instantly share code, notes, and snippets.

@NeQuissimus
Created October 29, 2018 00:55
Show Gist options
  • Save NeQuissimus/c2f0a6745a1d3a78e20ca5b10a601952 to your computer and use it in GitHub Desktop.
Save NeQuissimus/c2f0a6745a1d3a78e20ca5b10a601952 to your computer and use it in GitHub Desktop.
FizzBuzz
import scalaz._
import Scalaz._
def fizzbuzz(i: Int): String = Some("")
.mappend(Some("fizz").filter(_ => i % 3 == 0))
.mappend(Some("buzz").filter(_ => i % 5 == 0))
.filter(_.nonEmpty)
.getOrElse(i.toString)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment