Created
October 29, 2018 00:55
-
-
Save NeQuissimus/c2f0a6745a1d3a78e20ca5b10a601952 to your computer and use it in GitHub Desktop.
FizzBuzz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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