The versatility of Array methods

The versatility of Array methods

A covert introduction to simple monads using arrays.

5 thoughts on “The versatility of Array methods

  1. So I only scanned the article, but I am guessing it is similar to how Haskell instantiates the lazy lists data type into the Monad type class.

    Monadic “bind” is the concatMap function, “return” creates a list singleton, alternatives are list append operations, and the functor map is the ordinary list map function. The MonadFail instance is defined to automatically filter elements that don’t pattern match.

    It results in some of the most elegant code I’ve ever written.

    Like

Leave a comment