Skip to Content
Effective Haskell
book

Effective Haskell

by Rebecca Skinner
July 2023
Intermediate to advanced
670 pages
17h 13m
English
Pragmatic Bookshelf
Content preview from Effective Haskell

Looping

If you’ve been programming for very long, you might’ve heard of the “fizzbuzz” problem. It was once a common interview question that was asked to see whether candidates could write a simple program, and it’s still used these days as a common example when teaching new programmers. There are a few minor variations of the problem, but let’s consider this version of it:

Given a number, fizzBuzzCount, return a string that contains all of the numbers from one, up to and including fizzBuzzCount, except:

  1. If the number is evenly divisible by 3, but not evenly divisible by 5, replace it with the word “fizz”.

  2. If the number is evenly divisible by 5, but not evenly divisible by 3, replace it with the word “buzz”.

  3. If the number is evenly divisible ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Grokking Functional Programming

Grokking Functional Programming

Michal Plachta
Grokking Algorithms

Grokking Algorithms

Aditya Bhargava
The Rust Programming Language, 2nd Edition

The Rust Programming Language, 2nd Edition

Steve Klabnik, Carol Nichols

Publisher Resources

ISBN: 9798888650400Errata Page