N-Queens Combinatorial Problem - Polyglot FP for Fun and Profit – Haskell and Scala - Part 4
Published: Oct 04 2021
(for perfect image quality)
See how feeding FP workhorses map and filter with monadic steroids turns them into the intriguing mapM and filterM.
Graduate to foldM by learning how it behaves with the help of three simple yet instructive examples of its usage.
Use the powers of foldM to generate all permutations of a collection with a simple one-liner.
Exploit what you learned about foldM to solve the N-Queens Combinatorial Problem with an iterative approach rather than a recursive one.