Skip to content

Extendable implementation of FizzBuzz using higher order functions in Swift.

Notifications You must be signed in to change notification settings

elliereiselt/FunctionalSwiftFizzBuzz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Notes

After reading an article about implementing FizzBuzz with Monoids in Haskell, I wanted to try my hand at implementing FizzBuzz in Swift using higher order functions in an extendable way.

This implementation is super easy and extendable. Just add a new tuple value with a new output name for that value and you're done.

The implementation uses a tuple array rather than a dictionary due to the Swift dictionary reordering items which I didn't want.

The implementation uses filter, map, and reduce to create the "FizzBuzzBazz*" string for output.

About

Extendable implementation of FizzBuzz using higher order functions in Swift.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages